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

Change is always emitted with first blur event #42

Closed
vladiks opened this issue Oct 12, 2016 · 0 comments
Closed

Change is always emitted with first blur event #42

vladiks opened this issue Oct 12, 2016 · 0 comments
Labels

Comments

@vladiks
Copy link

vladiks commented Oct 12, 2016

The component always emits change event when I just click in the editable field and the click outside without any change. I can see the reason in emitChange function. There is condition html !== this.lastHtml which is never false on first blur event, because this.lastHtml initial value is never set so at this moment it is undefined. Change event is fired even if there was no change.

I think this.lastHtml should be set in constructor and also should also update on componentDidUpdate, so when blur or change event is fired for the first time, the variable this.lastHtml will be already filled with correct value.

@lovasoa lovasoa added the bug label Aug 5, 2018
lovasoa added a commit that referenced this issue Aug 5, 2018
@lovasoa lovasoa closed this as completed in 2d3db84 Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants