Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu disappears when scrollbar is touched (when not searchable) #471

Closed
pjm17971 opened this issue Sep 22, 2015 · 2 comments
Closed

Menu disappears when scrollbar is touched (when not searchable) #471

pjm17971 opened this issue Sep 22, 2015 · 2 comments

Comments

@pjm17971
Copy link

The fix for #397 doesn't seem to work for the case where the selector is not searchable (searchable=false). The menu vanishes when the scrollbar is touched.

chooser-bug

@burtyish
Copy link
Contributor

👍

@burtyish
Copy link
Contributor

When the menu is not searchable, this code in handleMouseDown causes the menu to close:

// for the non-searchable select, close the dropdown when button is clicked
if (this.state.isOpen && !this.props.searchable) {
    this.setState({
        isOpen: false
    }, this._unbindCloseMenuIfClickedOutside);
    return;
}

https://github.com/JedWatson/react-select/blob/master/src/Select.js#L367-L372

The code is supposed to close an open non-searchable menu when the Select-control is clicked (see #211). The problem is that handleMouseDown is used for both the Select-control and the menu. So clicking on the scrollbar triggers this code in the handler, closing the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants