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

Contenteditable fires event editcomplete double on blur #1360

Closed
terwarf opened this issue Feb 20, 2017 · 4 comments
Closed

Contenteditable fires event editcomplete double on blur #1360

terwarf opened this issue Feb 20, 2017 · 4 comments

Comments

@terwarf
Copy link

terwarf commented Feb 20, 2017

( Possible related to #902 )

I'm struggeling with the same problem described in #902
Playing around with your jsfiddle i discovered that inserting a editable_validate-handler causes the problem to appear.
See http://jsfiddle.net/terwarf/6jnt1g6u/ ( line 27 )
I don't know if it's intentional, but when you first press enter and then trigger blur, you even get 3 events (as the plugin won't fire on unchanged cells otherwise, i don't think so.)...

Thanks for this great plugin ;)

@Mottie
Copy link
Owner

Mottie commented Mar 7, 2017

Hi @terwarf!

Sorry for the long delay in responding, I've been away for the past 3 weeks.

I tested that demo by clicking on "John", pressing Enter and Tab twice:

focus John
focus Hood
blur John
focus 33
blur Hood

I get the same result in both the latest version of Chrome, Firefox, Opera and Edge for Windows. I don't own an Apple products so I was not able to test cases. Which browser & OS are you encountering this problem? And is there a different sequence I need to use to duplicate the problem described?

@terwarf
Copy link
Author

terwarf commented Mar 13, 2017

Hi @Mottie!

No problems, sorry for the somewhat misleading report. You need to edit the content for this to trigger.
When I load the page, click on "Hood", edit, then press Tab it results in:

focus Hood
editComplete Hoodie db-row-884 1 1
editComplete Hoodie db-row-884 1 2
focus 33

If I load the page, click on "Hood", edit, press Enter, then Tab, result is:

focus Hood
editComplete Hoodie db-row-884 1 1
editComplete Hoodie db-row-884 1 2
editComplete Hoodie db-row-884 1 3
focus 33

Tested in Chrome & Firefox running on Windows7

@Mottie
Copy link
Owner

Mottie commented Apr 2, 2017

Hi @terwarf!

Sorry again for not getting back to you earlier. I was able to reproduce the issue you're having.

If I removed all the "blur" event listeners from the widget code, it appears to fix this issue. I don't think this will cause any backwards compatibility issues, so I'll go ahead and update the master branch. Please test the version there and let me know if it fixes your problem.

@Mottie
Copy link
Owner

Mottie commented Apr 19, 2017

I'm guessing the patch fixed the issue... v2.28.8 is now available. Please feel free to reopen this issue if you continue to have issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants