mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Field): keep selection position after updating value (#11308)
This commit is contained in:
parent
d227429fdc
commit
7042d1c06e
@ -307,7 +307,9 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if (inputRef.value && inputRef.value.value !== value) {
|
||||
const { selectionStart, selectionEnd } = inputRef.value;
|
||||
inputRef.value.value = value;
|
||||
inputRef.value.setSelectionRange(selectionStart, selectionEnd);
|
||||
}
|
||||
|
||||
if (value !== props.modelValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user