Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
3.98k stars 609 forks source link

Fix modal focus on link/image add #1346

Open 35grain opened 1 year ago

35grain commented 1 year ago

When the editor is displayed within a Bootstrap modal, for example, the additional Trumbowyg modal inputs are not focused properly. This fix appends the modal box right after the Trumbowyg box so that hierarchically it can receive focus without issues.

Alex-D commented 1 year ago

I understand the fix, but I do not remember why it has been changed to the bottom of the body in the past :/

Alex-D commented 1 year ago

Ok, after finding out, it seems like the issue and PRs were:

So, your solution is not working either since it results again in a form inside another form :/

35grain commented 1 year ago

I see. Not sure what the correct solution is then to be fair /: Perhaps adding an option for selecting the parent form element AFTER which the Input Links modal should be inserted, otherwise expect default behaviour? This way it stays within the parent modal (when necessary) and is valid HTML.

Alex-D commented 1 year ago

That could be nice! I do not think this needs an option; it can be the default :)