mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
fix(Field): set selection range only when focused (#11333)
This commit is contained in:
parent
4e9d830dbf
commit
dde13fac3c
@ -309,7 +309,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 (state.focused) {
|
||||
inputRef.value.setSelectionRange(selectionStart, selectionEnd);
|
||||
}
|
||||
}
|
||||
|
||||
if (value !== props.modelValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user