Kekule.js icon indicating copy to clipboard operation
Kekule.js copied to clipboard

After closing the editor, the backspace does not work anymore in other input fields

Open sowiso opened this issue 2 years ago • 9 comments

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.

sowiso avatar Apr 05 '22 11:04 sowiso

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);

sowiso avatar Apr 05 '22 18:04 sowiso

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?

partridgejiang avatar Apr 06 '22 11:04 partridgejiang

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.

index.zip

sowiso avatar Apr 06 '22 20:04 sowiso

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, :).

partridgejiang avatar Apr 07 '22 02:04 partridgejiang

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.

sowiso avatar Apr 08 '22 13:04 sowiso

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

partridgejiang avatar Apr 08 '22 15:04 partridgejiang

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.

agrodet avatar Apr 25 '22 10:04 agrodet

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 avatar Apr 26 '22 11:04 partridgejiang

@partridgejiang As far as I'm concerned, it seems that the problem I described was solved.

agrodet avatar Apr 26 '22 13:04 agrodet