partridgejiang / Kekule.js

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

composer blocks backspace in form elements #318

Closed drlippman closed 2 months ago

drlippman commented 2 months ago

I have noticed that if the Composer widget is on the same webpage as a form element like an input or textarea, the composer event handlers appear to prevent backspace, delete, control-C, etc. from working in the form element. Mostly it appears to be keys that only trigger keydown, not keypress, but some keys like the arrow keys still work.

It does appear those keys are impacting the last-used composer, as a key event like Control-A will select-all in the editor, even if pressed while in the form element, so I'm assuming the composer is thinking it still has focus.

Is there a way to workaround this? Maybe some way to tell Kekule that the composer has lost focus when a form element gains focus?

partridgejiang commented 2 months ago

Hi @drlippman, thanks for the feedback. There was such a bug before but it should have been fixed already. Please check the Kekule.VERSION value in your application and try to update Kekule.js to the latest release, :).

drlippman commented 2 months ago

Apologies, I should have ensured I was using the latest version before posting. Thanks for your help and for all your work on Kekule.