react-overlays icon indicating copy to clipboard operation
react-overlays copied to clipboard

When manually controlling show, menu is undefined and an error is thrown

Open abourge opened this issue 5 years ago • 1 comments

Line 204 in Dropdown.js in tag 1.2.0 is (key === ' ' || (key !== 'Escape' && this.menu.contains(target)))

But when manually controlling show, sometimes the menu is not defined and an error is thrown on key down. I'm trying not to show the menu when there is no value in the input, ie when the input is just focused.

Can the line in this release be changed to (key === ' ' || (key !== 'Escape' && this.menu && this.menu.contains(target)))?

abourge avatar Sep 24 '19 22:09 abourge

I managed to bump to this as well while using react-bootstrap dropdown. I use input field as my custom toggle element, code executes line 204 and breaks.

As a workaround I'm just going to hide the component using display: hidden style for the dropdown menu

jniemin avatar Sep 25 '19 23:09 jniemin