lexxy 0.9.26 → 0.9.27

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5c63b2cb8499843f516d8404a2a7573f93452f753b54672b53d80a60242d0ef
4
- data.tar.gz: 13d59b10d606353cbc379ea5e940b40647fbe17a497f11a565c633ca1ae51519
3
+ metadata.gz: 1ef504d8ff6c3ee45519815bb36ea8c2d21316f8032c87967602138c88f4457b
4
+ data.tar.gz: 95e79bbbccdffe031d6938acce662d7d466fc248c63b609d0b6a058e9f586da1
5
5
  SHA512:
6
- metadata.gz: 0e0b6c3b8763c773fbc0ebe6a4d17cc5c8ee00813c48e66151975640daf3866b9a9558128584812aba21de840982ff0273200158b529343fd98b0992641622b8
7
- data.tar.gz: 72db851395aea2ad408a62dd78afd2e0cea0843b1484f39a19755f58d6a8a65c482c029bb876d5f109018820bee4b8141365976b35508bfd83adc0c9754dd543
6
+ metadata.gz: d600ab9f59fa036b56143d081ecadecde64c24f674639d64067add0bebb276ab4da142c0022802e6cfe5c656902f866ae4fecc80a37ba63e8385d567e3517caa
7
+ data.tar.gz: a0eb4b38a69a6f436a611f5023e078bfff26b37152603f2f3d923256c1e57672845c0bed337cec6c38989582e400be3a24ff7d9e803782d0c56dc94bb5f7995f
@@ -11085,10 +11085,34 @@ class Selection {
11085
11085
 
11086
11086
  this.editor.registerCommand(ie$4, () => {
11087
11087
  this.#syncSelectedClasses();
11088
- }, io)
11088
+ }, io),
11089
+
11090
+ this.editor.registerCommand(ie$4, () => {
11091
+ this.#preserveFocusOfOtherFields();
11092
+ return false
11093
+ }, lo)
11089
11094
  );
11090
11095
  }
11091
11096
 
11097
+ // Firefox (152+) keeps window.getSelection() anchored inside the editor after focus
11098
+ // moves to another field, and fires document selectionchange for every keystroke
11099
+ // typed there. Lexical reads that stale selection, reconciles, and pulls focus back
11100
+ // into the editor — stealing it mid-typing. When another text-entry field owns focus,
11101
+ // tag the update so Lexical leaves the DOM selection (and with it, focus) alone.
11102
+ #preserveFocusOfOtherFields() {
11103
+ if (this.#anotherFieldIsFocused) {
11104
+ Os(qn);
11105
+ }
11106
+ }
11107
+
11108
+ get #anotherFieldIsFocused() {
11109
+ const rootElement = this.editor.getRootElement();
11110
+ const activeElement = rootElement?.ownerDocument.activeElement;
11111
+
11112
+ return activeElement && !rootElement.contains(activeElement) &&
11113
+ (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA" || activeElement.isContentEditable)
11114
+ }
11115
+
11092
11116
  #listenForNodeSelections() {
11093
11117
  this.#listeners.track(this.editor.registerCommand(se$5, ({ target }) => {
11094
11118
  if (!qs(target)) return false
Binary file
Binary file