-
Notifications
You must be signed in to change notification settings - Fork 584
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
[feature] implement a clickoutside event #266
Comments
Does the |
ClickoutFiresChange works great, but it not solve the problem. A generic clickoutside event would give more flexibility, as you can know how a user is closing the color picker and you can implement an event handler to better customize the user experience. Concerning how I'm using spectrum, it's a bit tricky because I've to force the trigger change of the input field inside the "move" callback handler. Due to this triggering I lose the value as-was before opening the color picker. A clickoutside event will give me the ability to restore a value previously stored with the open event. |
It sounds like what would help is something like #173, where this would be an option (also related - #250). Getting all of these events tamed and unified has proven to be tricky. In theory we could add an option to the hide() function to notify that the cancel button is clicked and send this along in the event, but that would add even more cases to handle for the previous issues. I can't think of a fix that won't add extra complexity off the top of my head - I think it would be preferable to tack #173, since that will resolve quite a few open and related issues, and make your use case much easier. There are a variety of ways you could work around this for now - one would be to digging into the spectrum("container").find(".sp-cancel") and binding an event on mousedown to set a flag that this it is being clicked, then clear that flag on document mouseup. |
Ok, Thanks for the suggestion.I will try to find a workaround. |
Hey Brian, |
I think it would be very useful knowing how a user is closing a color picker.
he is clicking outside the colorpicker or he is hitting the cancel button?
I wondered if is there a way to obtain this without implementing a clickoutside event.
thank you very much in advance.
The text was updated successfully, but these errors were encountered: