-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Inputs in Custom Modal lose focus to the editor in the background #6870
Comments
Hi @jrmd, Thanks for the report. This will be a hard bug to fix without steps to reliably reproduce. Can you do more debugging on your end to see if you can track down the source? |
Thanks for the reply @danielbachhuber Could the issue be caused by my modal markup being inside of the block? Im not exactly sure how the highlighting of blocks work but I'm assuming a |
I decided to try this without any form elements and just a semi-transparent overlay on the content and if i click and drag around, it still selects the blocks; So it sounds like my theory above could be correct. |
This sounds like it could be it. Can you share some example code that reproduces the issue? |
hey @danielbachhuber here is a demo block that will produce the same results - https://gist.github.com/jrmd/920e6c2c682ec46a7f9613733a75b5bc If you add a few extra blocks into your page then toggle the overlay you should be able to highlight them through the overlay |
Thanks @jrmd |
The issue I think is that the block is rendering the modal inline where in general we render modals outside of the current divs. Did you try using |
I do believe that would be the issue; however it would be nice to resolve it in someway or perhaps better document how to do this. Regarding |
Agreed, it would be good to find out why this behavior is happening and whether it's legit or not. But yeah as a workaround try using |
Thanks for the help @youknowriad :) |
@youknowriad So I got time to test react modal and i still get the same issue; so it seems it being inside the content isn't the issue |
Thanks for the tests, this will help debugging. |
Is this also the case with our internal modal wrapper? |
Hey @jrmd Jerome and others. |
@youknowriad Is this something you can take a closer look at in your work on modals? |
In-house Design System Modal Gutenberg Modal Interesting. I'm making heavy use of formatting, Within a modal of any kind, I can't seem to get a RichText box to work. Immediately upon clicking, focus is restored to the core editor instance. No toolbar either (the toolbar in the video is literally just a In the above example when typing into one of the inputs, they're setting attributes for a format that's being applied. This pattern works really well for me, however I'd like to apply formatting further, to those attributes. Think My idea was to use a RichText as the input, but the above happens. I've scoured for solutions, applied This issue seemed related so I figured I'd pile on a bit :) Apologies if this is not related. @youknowriad, @paaljoachim, @mtias any thoughts? |
Hey there! old issue here, I've been trying to test the original reported issue and in my testing I can't click through the overlay using the gist provided here #6870 (comment) So I guess this might be fixed? |
Closing as no replies, but feel free to reopen a new issue if you still experience the issue. |
Describe the bug
Wordpress 4.9.6
Gutenberg 2.9.1
I have created a custom block that opens a modal (for data editing) however, when trying to focus on an input the editor sometimes takes focus away from the input and highlights blocks in the background, this isn’t a consistent thing and doesn’t happen 100% of the time
To Reproduce
Expected Behaviour
Mouse events don’t pass down to the editor and lose focus
Screenshot
Video: Screen Capture on 2018-05-21 at 10.58.37.mov • Droplr
Desktop
OS: Mac/Windows
Browser: Chrome/Firefox
Version: Latest on Chrome/ Nightly on Firefox
The text was updated successfully, but these errors were encountered: