Skip to content

Commit 8f1ebc1

Browse files
filter keyboard events by type to ignore autocompletion
1 parent 0e9f650 commit 8f1ebc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nicegui/elements/keyboard.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ export default {
22
mounted() {
33
for (const event of this.events) {
44
document.addEventListener(event, (evt) => {
5+
// https://github.com/zauberzeug/nicegui/issues/4290
6+
if (!(evt instanceof KeyboardEvent)) return;
7+
58
// https://stackoverflow.com/a/36469636/3419103
69
const focus = document.activeElement;
710
if (focus && this.ignore.includes(focus.tagName.toLowerCase())) return;
11+
812
if (evt.repeat && !this.repeating) return;
13+
914
this.$emit("key", {
1015
action: event,
1116
altKey: evt.altKey,

0 commit comments

Comments
 (0)