Skip to content

[Feature request] onClose / onBlur #14

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

Open
tonoslav opened this issue Jun 6, 2018 · 2 comments
Open

[Feature request] onClose / onBlur #14

tonoslav opened this issue Jun 6, 2018 · 2 comments

Comments

@tonoslav
Copy link

tonoslav commented Jun 6, 2018

I need posibility to set callback when multiple is true and after user choose values in select dropdown and click outside

I think it would be ok to call it after this line

this.toggleOpenListState(false);

@BusinessDuck
Copy link
Owner

BusinessDuck commented Jun 12, 2018

@tonoslav You can extend Select component and redefine private method for example:


class MyCustomSelect extends Select {
   /**
     * Track the outside of selector clicks and call close if click was outside of
     * @param event
     * @returns {boolean}
     */
    private handleClickOutside = (event, callback = () => null) => {
        const result = super.handleClickOutside();
        callback();
        return result;
    }
}

@BusinessDuck
Copy link
Owner

Also, you can try handle blur event manually

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