-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
onBlur event #150
Comments
Hey, is it still open to investigate? |
Yes @pavelee |
I will look into it. It's little bit tricky but I will try to make proposal 😇 |
@giorgosart IF Yes i can create a PR with same |
@MaheshTrapasiya how are you going to achieve that? |
Using setTimeout or debounce for 500 ms? |
@giorgosart any suggestions on this? |
@MaheshTrapasiya I need some more time to find possible solutions. 🙏 Default timeout is not solution for everyone who relay on this feature. Will be consider as a bug for them. 😕 We have conflict here because cancel on blur was design to cancel on blur. Did you consider to check if save on blur would work for you? Maybe it cloud be helpful if you describe your business case to solve |
I analyzed problem again, my proposal is to catch when we user mouseover save button, if that is the case, just don't let to trigger cancel on blur. Edge case is mobile device. Not sure if that would be possible to catch as well, need to find the way. That's the best possible solution i've found. I would like to avoid any timeout solutions. If there is no objections, I will try to prepare PR with proposal. |
Hi @pavelee it would be good to try and see what you have in mind. |
@pavelee What about touch then? We can't rely on mouseover on touch devices... |
Describe the bug
the onBlur function prop only provides the temp value as an argument, it should also pass in the native event so we can see which target was clicked.
this is helpful to be able to determine if they clicked the save/cancel buttons and either perform a save on blur or cancel on blur.
right now if we want to just use cancelOnBlur but be able to still press the save button to save the data we can't it just always cancels on blur even if you click on the save button.
https://codesandbox.io/s/react-easy-edit-sandbox-forked-2ort4y?file=/index.js
To Reproduce
Steps to reproduce the behavior:
Expected behavior
onBlur should pass in the native event or cancelOnBlur should not trigger cancel if the on save is pressed
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: