mirror of
https://github.com/youzan/vant.git
synced 2026-04-02 02:01:00 +08:00
fix(Field): keep selection position after updating value (#11308)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user