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

Emiting change on blur #19

Closed
mertkahyaoglu opened this issue Jun 29, 2016 · 5 comments
Closed

Emiting change on blur #19

mertkahyaoglu opened this issue Jun 29, 2016 · 5 comments

Comments

@mertkahyaoglu
Copy link

mertkahyaoglu commented Jun 29, 2016

Why do we need emitting change on blur? In my project, a save button is enabled if any of the inputs change but if the user changes nothing but just lose focus, it enables the button again.

Edit: #16 fixes the problem but 1.1.0 version is available on npm. Can we publish the 2.0.0?

@slorber
Copy link
Collaborator

slorber commented Jun 29, 2016

Hi,

@mertkahyaoglu theinitial code comes from this SO question:
http://stackoverflow.com/questions/22677931/react-js-onchange-event-for-contenteditable

I don't know why @brigand did put a onBlur listener, but in my experience I don't see much value in keeping it.

My current UncontrolledContentEditable I use in production looks like this and does not been to emit change on blur:
https://gist.github.com/slorber/b84c6c7c2d2c3c6250c53a001b674688

@mertkahyaoglu
Copy link
Author

@slorber Thanks for quick response. Actually #16 fixes the problem I guess, but it is not available on npm (still 1.1.0). With that PR, I can override the onBlur event by passing an empty function to prevent emiting change.

@jvalente
Copy link

jvalente commented Aug 19, 2016

Hello everyone. Here are my warm regards to everyone using contentEditable in general and contentEditable with React in particular.

Here's a question: considering that the current solution won't work on IE11 because of this and by definition (I confess that I didn't take a look at the React SynteticEvent creation based on DOM events), what do you guys think about using onKeyUp instead of onInput here?.

Kind regards and thank you for your work.

@slorber
Copy link
Collaborator

slorber commented Aug 19, 2016

Hmmm I've just done some test and for me it seems onInput works fine on IE, however I've been reported there might be a problem on my app on IE11 where a text paste does not trigger onInput.

I'll have to digg deeper another day

@Treora
Copy link
Collaborator

Treora commented Sep 1, 2016

The original onBlur issue seems resolved, so closing this one. The question about onInput events in IE11 may be worth opening as a separate issue, if it is still relevant.

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

4 participants