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

file input click event breaks UI #1039

Open
imacrayon opened this issue Jan 9, 2023 · 0 comments
Open

file input click event breaks UI #1039

imacrayon opened this issue Jan 9, 2023 · 0 comments

Comments

@imacrayon
Copy link

I have a Trix editor sitting in a dialog modal. The dialog is configured to close when a user clicks outside of the dialog content. When a user clicks the "Attach Files" button in the Trix toolbar, my dialog closes.

Looking at the Trix file input config, it appears that clicking "Attach Files" appends an <input type="file"> to the DOM <body> and then triggers a click on the input, thus causing my dialog to close.

If the <input type="file"> were instead inserted as a sibling of the <trix-editor> element my modal wouldn't break. Alternatively, if the Trix file input config could allow for changing where the <input type="file"> element is inserted into the DOM that would provide a solution to my issue as well.

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