Kekule.js
Kekule.js copied to clipboard
After closing the editor, the backspace does not work anymore in other input fields
After closing the editor, the backspace does not work anymore in other html input fields on the page. It looks like the event listeners keeps preventing defaults.
This seems to solve it, but it would be nice if the editor removes these listeners on blur
document.querySelector('html').removeEventListener('keydown', Kekule.Widget.globalManager.reactUiEventBind)
;
Hi @sowiso, thanks a lot for the feedback. However, I failed to reproduce the issue myself. Could more details be provided, and if possible, could a demo HTML page be attached here?
hi @partridgejiang of course, here's an example html file. First draw something in kekule, then type text in the input and try to remove it with backspace.
Hi @sowiso, thanks again for the demo page, the bug has been located and fixed. Please check the latest commits and use the min js files in /dist directory currently, :).
Hmm, it does still to appear happening on my system, even with the index.html that I shared. Both with the local install via git clone and with the cdn.
The new dist has not been published to cdn yet, so the local js are required. The attachment below is a modification of your index.html, with new local min files instead of
It may not be very polite to intervene in somebody else's issue, but I thought I should report that I was facing the same issue and that it was indeed solved by replacing the .min.js
files. However, it seems that I cannot go back easily to the editor.
I mean
- Select a part of a molecule in the editor,
- go to another field, and delete something. It works
- Go back to the editor by clicking directly an atom to delete. Pressing the delete button delete the text in the input field.
Or in a shorter version:
- With a molecule displayed in the editor directly, select an input field somewhere else in the page.
- Click an atom to delete. The editor doesn't take the focus, and the text of the input field is deleted instead of the atom.
Note that clicking a button of the editor seems to retrieve the focus.
I am using Composer, on Firefox, with npm, but with the current .min.js
files.
This behavior does not occur with the current published version (obviously), but I'm not sure it's directly related to the correction of this issue or not. If it's a completely different issue, let me know and I'll happen a new one.
Hi @agrodet, thanks again for the feedback. Now a hot fix has been applied, please check the new dist file and have a test.
@partridgejiang As far as I'm concerned, it seems that the problem I described was solved.