Bug Type: Component
Environment
- Vue Version:
3.2.45
- Element Plus Version:
2.2.27
- Browser / OS:
Chrome 108.0.5359.98/ macOS 13.1
- Build Tool:
Vite
Reproduction
Related Component
el-input
Reproduction Link
Element Plus Playground
Steps to reproduce
input绑定初始值为'22222222',formatter返回值为 ${val}
.replaceAll('2', '!'),光标初始位置处于绑定值中间任意位置,输入字符2,光标会跳到最后位置
What is Expected?
光标保持在输入位置
What is actually happening?
光标跳到最后位置
Additional comments
(empty)
2条答案
按热度按时间ffdz8vbo1#
replaceAll 替换为了一个新的字符串,替换完成之后光标在字符串被顶到最后,感觉应该是正常行为
oknrviil2#
Hi. The problem is that the formatter is not called during initialization. When this pr is merged, then the cursor will work correctly (the first time a number is entered)