From 88329ff104877258866ba095c312d6756faa804d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 12 Mar 2023 18:23:24 +0200 Subject: [PATCH] Fixed: (UI) Use `event.composedPath()` --- frontend/src/Search/SearchIndex.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/Search/SearchIndex.js b/frontend/src/Search/SearchIndex.js index f7524122f..012dc48da 100644 --- a/frontend/src/Search/SearchIndex.js +++ b/frontend/src/Search/SearchIndex.js @@ -84,6 +84,10 @@ class SearchIndex extends Component { } } + componentWillUnmount() { + window.removeEventListener('keyup', this.onKeyUp); + } + // // Control @@ -192,7 +196,8 @@ class SearchIndex extends Component { onKeyUp = (event) => { const jumpBarItems = this.state.jumpBarItems.order; - if (event.path.length === 4) { + + if (event.composedPath && event.composedPath().length === 4) { if (event.keyCode === keyCodes.HOME && event.ctrlKey) { this.setState({ jumpToCharacter: jumpBarItems[0] }); }