@lvce-editor/renderer-process 30.64.5 → 30.64.6
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.
- package/dist/rendererProcessMain.js +14 -0
- package/package.json +1 -1
|
@@ -7778,8 +7778,22 @@ const handleFocus$2 = event => {
|
|
|
7778
7778
|
state$6.codingFocus = new WeakRef(target);
|
|
7779
7779
|
}
|
|
7780
7780
|
};
|
|
7781
|
+
const handleFocusOut$2 = event => {
|
|
7782
|
+
const address = event.target;
|
|
7783
|
+
if (!(address instanceof HTMLInputElement) || address.name !== 'simple-browser-address') return;
|
|
7784
|
+
// Native WebContents focus can leave activeElement pointing at this input.
|
|
7785
|
+
// Defer so reparenting or a newer focus choice can preserve its selection.
|
|
7786
|
+
setTimeout(() => {
|
|
7787
|
+
const document = address.ownerDocument;
|
|
7788
|
+
if (!address.isConnected || document.hasFocus() && document.activeElement === address) return;
|
|
7789
|
+
clearTimeout(pendingSelections.get(address));
|
|
7790
|
+
pendingSelections.delete(address);
|
|
7791
|
+
address.setSelectionRange(0, 0);
|
|
7792
|
+
});
|
|
7793
|
+
};
|
|
7781
7794
|
const listen = () => {
|
|
7782
7795
|
document.addEventListener('focusin', handleFocus$2);
|
|
7796
|
+
document.addEventListener('focusout', handleFocusOut$2);
|
|
7783
7797
|
};
|
|
7784
7798
|
const restoreCodingFocus$1 = () => {
|
|
7785
7799
|
const target = state$6.codingFocus?.deref();
|