Skip to content
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

scrollableContainer Option Doesn't Work with Shadow DOM in Micro Frontend #402

Open
bertanyaman opened this issue Sep 25, 2024 · 0 comments

Comments

@bertanyaman
Copy link

bertanyaman commented Sep 25, 2024

Hello Froala team,

I am using the Froala Editor as a licensed package within a micro frontend architecture where CSS isolation is handled through Shadow DOM. In this setup, the editor is embedded in a shadow root, and I am trying to use the scrollableContainer property. I have set the property value to a string that matches the id of a div inside the Shadow DOM, for example:

scrollableContainer: "#myContainer"

However, it seems that the editor cannot find the container within the Shadow DOM, likely because Froala is attempting to retrieve the element using document.getElementById("myContainer"), which only works for elements in the Light DOM.

You can reproduce the issue in the following CodeSandbox:
CodeSandbox Link

I believe this issue is caused by the way the editor interacts with the DOM outside of the shadow boundary. It would be helpful if Froala could either support querying elements within the Shadow DOM or provide a way for developers to pass a reference to the scrollableContainer instead of just a string.

Thank you for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant