@lvce-editor/renderer-process 30.64.1 → 30.64.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9274,7 +9274,7 @@ const setInputValues = (viewletId, items) => {
|
|
|
9274
9274
|
const setCheckboxValue = (viewletId, name, value) => {
|
|
9275
9275
|
setElementProperty(viewletId, name, 'checked', value);
|
|
9276
9276
|
};
|
|
9277
|
-
const setSelectionByName = (viewletId, name, start, end) => {
|
|
9277
|
+
const setSelectionByName = (viewletId, name, start, end, expectedValue) => {
|
|
9278
9278
|
const selector = `[name="${name}"]`;
|
|
9279
9279
|
const instance = get$b(viewletId);
|
|
9280
9280
|
if (!instance) {
|
|
@@ -9287,6 +9287,10 @@ const setSelectionByName = (viewletId, name, start, end) => {
|
|
|
9287
9287
|
if (!$Element) {
|
|
9288
9288
|
return;
|
|
9289
9289
|
}
|
|
9290
|
+
// A focus response may arrive after the user has already edited the input.
|
|
9291
|
+
if (expectedValue !== undefined && $Element.value !== expectedValue) {
|
|
9292
|
+
return;
|
|
9293
|
+
}
|
|
9290
9294
|
$Element.selectionStart = start;
|
|
9291
9295
|
$Element.selectionEnd = end;
|
|
9292
9296
|
};
|