From ba1cf034b2a1b9fb609afa37bf763ff4fb4a096a Mon Sep 17 00:00:00 2001 From: Christine Vadai Date: Thu, 24 Oct 2019 10:32:03 -0700 Subject: [PATCH 1/2] Closes the open dropdown when it is clicked on --- src/Select/Select.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Select/Select.js b/src/Select/Select.js index 0cb013a..daa447a 100644 --- a/src/Select/Select.js +++ b/src/Select/Select.js @@ -204,14 +204,19 @@ class WrapperSelect extends React.PureComponent { clearInterval(this.focusedTimeout) this.focusedTimeout = setTimeout(() => { - this.shouldFireClickOutsideHack = true + this.shouldFireClickOutsideHack = true; + if (_this7.state.isOpened) { + _this7.closeOptions(); + } + else { + _this7.openOptions(); + } }, 200) this.setState({ isFocused: true }) - this.openOptions() this.setFocus() } From d669bf6222a28248e02291a40bc3d6c7672a9b23 Mon Sep 17 00:00:00 2001 From: Christine Vadai Date: Thu, 24 Oct 2019 11:00:16 -0700 Subject: [PATCH 2/2] Closes the open dropdown when it is clicked on --- lib/Select/Select.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Select/Select.js b/lib/Select/Select.js index 7e869f9..349b49d 100644 --- a/lib/Select/Select.js +++ b/lib/Select/Select.js @@ -325,13 +325,18 @@ clearInterval(this.focusedTimeout); this.focusedTimeout = setTimeout(function () { _this7.shouldFireClickOutsideHack = true; + if (_this7.state.isOpened) { + _this7.closeOptions(); + } + else { + _this7.openOptions(); + } }, 200); this.setState({ isFocused: true }); - this.openOptions(); this.setFocus(); } }, {