#36662 closed defect (bug) (fixed)
WpLink stopped working in bootstrap modals.
Reported by: | jackreichert | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.5 |
Component: | Editor | Keywords: | |
Focuses: | javascript | Cc: |
Description (last modified by )
Since updating to 4.5 wplink won't work on a page that has 'modal-open' on the body. This class is added by bootstrap modals plugin (https://github.com//twbs/bootstrap/blob/master/js/modal.js#L63).
This was introduced in revision [36677] on line 390 (https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js?rev=36677#L390). It was unclear to me from the commit message why it was added.
Change History (8)
#3
@
8 years ago
That certainly makes sense, I submitted the ticket because I have implemented instances of wp_editor inside a modal.
#4
@
8 years ago
Perhaps using document.elementFromPoint(x,y) would work since we're already absolute positioning wplink...
#5
@
8 years ago
Yes, document.elementFromPoint()
should work but we will have to account for all cases like inline editor, a "real" iframe with an iframe editor in it, etc. As TinyMCE is very easy to customize, detecting all cases can be somewhat tricky.
Alternatively can set a flag only for the wpLink modal. Seems this would cover it for now as all other modals there have higher z-index/are "over" the toolbar.
This was added to prevent the inline link toolbar opening while a modal is shown or showing over open modals. There are cases when a modal would focus the editor that's under it, and as we show the inline toolbar on editor focus, it would open.
Will have to change this behaviour (although it seems logical) or find another way to detect when the editor is actually visible and accessible and when it is under a modal (if that is at all possible).