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

Does not trigger events #21

Open
gunn opened this issue Sep 20, 2016 · 2 comments
Open

Does not trigger events #21

gunn opened this issue Sep 20, 2016 · 2 comments

Comments

@gunn
Copy link

gunn commented Sep 20, 2016

Great project! It would be even nicer if when a textfield was edited, the onchange event fired.

My use case is for editing markup that is previewed as html and updates live with typing.

@danhper
Copy link
Owner

danhper commented Sep 22, 2016

@gunn Hi, thanks for the feedback!
For now the keypress event is fired, but I am not sure that firing the onchange event everytime
is a great idea, as it differs from the normal behavior of a textarea or input, where it fires only
when the input is unfocused. Maybe we could use a keyboard shortcut to fire it from Atom?
What do you think?

@gunn
Copy link
Author

gunn commented Sep 23, 2016

@tuvistavie yes I think you're right that always firing onchange would be inconsistent.

The reason I was thinking that is because of React's onChange attribute.

Here's a very simple test-case for working with a React textarea - http://output.jsbin.com/funonayaki Source here. You can see it updates correctly when typing in the browser, but not from atom. Maybe the oninput event would be the correct one?

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