From aab8e314e557b79723a1471907750ea4010d5afe Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 22 Feb 2024 13:37:54 +0800 Subject: [PATCH] unsubs from active element when out of focus --- src/components/OptionsSelector/BaseOptionsSelector.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 690897d548ce..0ef0a69cf6bf 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -125,8 +125,11 @@ class BaseOptionsSelector extends Component { // Unregister the shortcut before registering a new one to avoid lingering shortcut listener this.unSubscribeFromKeyboardShortcut(); if (this.props.isFocused) { + this.subscribeActiveElement(); this.subscribeToEnterShortcut(); this.subscribeToCtrlEnterShortcut(); + } else { + this.unSubscribeActiveElement(); } }