diff --git a/packages/ui-toolkit/src/components/atoms/Dropdown/Dropdown.tsx b/packages/ui-toolkit/src/components/atoms/Dropdown/Dropdown.tsx index 3b5f588b..c8c6eadc 100644 --- a/packages/ui-toolkit/src/components/atoms/Dropdown/Dropdown.tsx +++ b/packages/ui-toolkit/src/components/atoms/Dropdown/Dropdown.tsx @@ -29,7 +29,7 @@ class Dropdown extends React.PureComponent { componentWillUnmount() { document.removeEventListener('click', this._onWindowClick); document.removeEventListener('touchstart', this._onWindowClick); - document.removeEventListener('keyup', this._onKeyDownHandler); + document.removeEventListener('keydown', this._onKeyDownHandler); } diff --git a/packages/ui-toolkit/src/components/atoms/Select/Select.tsx b/packages/ui-toolkit/src/components/atoms/Select/Select.tsx index db6a4cbc..9b84b214 100644 --- a/packages/ui-toolkit/src/components/atoms/Select/Select.tsx +++ b/packages/ui-toolkit/src/components/atoms/Select/Select.tsx @@ -39,6 +39,13 @@ class Select extends React.PureComponent { } + componentWillUnmount() { + this.optionsRefArr.forEach((ref: any) => (ref.current = null)); + this.optionsRefArr = []; + this.selectDropdownRef = null; + } + + render() { const { data: options } = this.props;