Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 自定义编辑器的getValue方法比validateValue方法要先执行,与官方提供的流程图不符 #3190

Open
robertyclin opened this issue Dec 24, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@robertyclin
Copy link

Version

1.14.0

Link to Minimal Reproduction

https://visactor.io/vtable/demo/edit/custom-editor

Steps to Reproduce

image image

Current Behavior

先执行getvalue然后再执行validateValue

Expected Behavior

先执行validateValue然后再执行getvalue

Environment

- OS:macOS Monterey
- Browser:Chrome 96.0.4664.55
- Framework:Vue@3

Any additional comments?

No response

@robertyclin robertyclin added the bug Something isn't working label Dec 24, 2024
@fangsmile fangsmile self-assigned this Dec 24, 2024
@robertyclin
Copy link
Author

image 并且getvalue执行2次,导致校验规则不通过的时候,表格的值也更新了

@fangsmile fangsmile assigned Rui-Sun and fangsmile and unassigned fangsmile and Rui-Sun Dec 25, 2024
@fangsmile
Copy link
Contributor

image
应用户需求 这个函数原来是没有参数的 现在传递了几个参数,所以调用到了getValue。
请问你是什么场景?getValue执行两次会影响你的逻辑吗?validateValue返回的什么值 导致单元格更新了新值呢? @robertyclin
image

@robertyclin
Copy link
Author

getValue方法return的值就直接更新到表格单元格了,而validateValue如果是校验失败的则无法退出编辑状态,输入框没有隐藏,而getValue方法return的值刷新了单元格,导致单元格的宽度发生变化,输入框没法完全遮住单元格了。

@fangsmile
Copy link
Contributor

@robertyclin 可以提供codesanbox复现demo 我这没有复现你说的返回false校验失败还退出编辑状态的情况

@robertyclin
Copy link
Author

validateValue返回false后编辑状态并没有退出,这个是正常的。问题是getValue方法return一个new value后,表格单元格内容也更新为new value了,单元格的长度会发生变化,这样编辑框可能会没法完全覆盖住单元格了。

@fangsmile
Copy link
Contributor

给出个复现demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants