From 0cbca1485c395d6387c9cd795530fbf3eae76acc Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:59:31 -0400 Subject: [PATCH] fix(SelectToggle): corrected removeEventListener on unmount for v4 (#9381) --- packages/react-core/src/components/Select/SelectToggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-core/src/components/Select/SelectToggle.tsx b/packages/react-core/src/components/Select/SelectToggle.tsx index 05d95a922b3..30d1db4726e 100644 --- a/packages/react-core/src/components/Select/SelectToggle.tsx +++ b/packages/react-core/src/components/Select/SelectToggle.tsx @@ -104,7 +104,7 @@ class SelectToggleBase extends React.Component { } componentWillUnmount() { - document.removeEventListener('click', this.onDocClick); + document.removeEventListener('click', this.onDocClick, { capture: true }); document.removeEventListener('touchstart', this.onDocClick); document.removeEventListener('keydown', this.handleGlobalKeys); }