@HolgerJeromin commented on this pull request.
> @@ -12,6 +12,42 @@
preview.children(".richtext").empty();
});
+ /*
+ * Block arrow keys on richtext tabs to prevent Bootstrap's buggy keyboard
navigation.
+ * Uses capture phase to intercept before Bootstrap handles the event.
+ */
+ document.addEventListener("keydown", function (e) {
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key))
return;
+ if (!e.target.matches?.(".richtext_container
button[data-bs-toggle='tab']")) return;
+
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation();
+ }, true);
Make this more clear:
```suggestion
}, {capture: true});
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6691#pullrequestreview-3643109413
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6691/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev