-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TinyMCE loses focus on modal dialog #2779
Comments
@benouat could you PTAL if / when you've got free cycles? |
I'll have a look asap.
|
I can actually also reproduce it in Safari, but only when the first input contains something. |
@benouat nothing to do with the input, simpler reproduction scenario is:
It brings back focus to the last focused element before entering the iframe |
@maxokorokov in this case I don't see any room for improvement here... The iframe is messing things around. |
@maxokorokov thank you for simplifying repro steps. @benouat I could not find how to avoid using iframe. However, if I get rid of iframe, I will face with the styling issues. So I do not think that it can be the way of fixing the focus issue there. |
on click anymore. Only datepicker input will. Closes ng-bootstrap#2779
@igor-shubin the fix in #2798 should fix the issue. Nonetheless, looking at the documentation of TinyMCE, I found an interestingly & surprisingly outdated article that made me realise: Pasting this code inside your modal component would also fix it with current @HostListener('click', ['$event'])
onClick(event) {
// Click is initiated from any of the toolbar button action
if ((event.target as HTMLElement).closest(".mce-top-part")) {
event.stopImmediatePropagation();
}
} |
on click anymore. Only datepicker input will. Closes ng-bootstrap#2779
@benouat thanks, the fix with stopping event propagation works fine with |
🤦♂️You're right, I'll update the snippet right away! Thanks |
Add official TinyMCE component on a modal window.
Steps to reproduce:
Expected result:
Actual result:
Please note: the bug cannot be reproduced on @ng-bootstrap/ng-bootstrap 2.0.0
As I can see the problem is with focus-trap component.
Could you please help me to resolve this issue?
Library versions:
angular: 6.0.3
tinymce: 4.8.3
@tinymce/tinymce-angular: 2.3.0
@ng-bootstrap/ng-bootstrap 3.3.0
The text was updated successfully, but these errors were encountered: