tinymce / tinymce

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
https://www.tiny.cloud
Other
14.83k stars 2.23k forks source link

I can't find what I'm looking for: integrations/bootstrap.md #6536

Closed ucimo closed 2 months ago

ucimo commented 3 years ago

I need Vanila JS, React or Angular implementation for event propagation , basically anything that's not JQuery image

tylerkelly13 commented 3 years ago

Hi @obrovacm ,

Have you tried our React or Angular integrations:

Is this what you were looking for?

Tyler

ucimo commented 3 years ago

Hi @tylerkelly13 ,

No, I need to prevent bootstrap dialog/modal from blocking focusin on tinymce link dialog and I don't want to import JQuery just for that single task. So I'm looking for a translation of this code to Vanila JS or any JS framework in order to use it in my react app. Currently, I'm using bootstrap's enforceFocus={false} as a workaround, but I'm losing accessibility for blind people (they can now focus any element that's beneath the modal...) which is far from ideal. Could you maybe transpile this code to Vanila JS?

tylerkelly13 commented 3 years ago

Hi @obrovacm

I'll transfer this issue to the tinymce/tinymce repository so the developers can have a look into this issue.

Tyler

tiny-james commented 3 years ago

Here's a direct conversion to Javascript. The caveat is that it doesn't support Internet Explorer (due to using closest). There is a pollyfill on MDN if you need that ( https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill )

document.addEventListener('focusin', function(e) {
  if (e.target.closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
    event.stopImmediatePropagation();
  }
});
tiny-stale-bot commented 3 months ago

This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.

tiny-stale-bot commented 2 months ago

This issue was closed because it has been stalled for 30 days with no activity.