partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

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

Open sowiso opened 2 years ago

sowiso commented 2 years ago

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 commented 2 years ago

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

partridgejiang commented 2 years ago

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?

sowiso commented 2 years ago

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

partridgejiang commented 2 years ago

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

sowiso commented 2 years ago

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.

partridgejiang commented 2 years ago

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 Githubissues.

  • Githubissues is a development platform for aggregating issues.