-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add an overlay to the html block preview to fix block selection in Firefox #20425
Conversation
Size Change: +57 B (0%) Total Size: 866 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, it makes sense to me but I was wondering if we ever want people to access the HTML (click on links, ...)
Good question, hadn't thought about that, will have another look at it with that in mind. |
@youknowriad I modified it so the overlay is only in place if the block is not selected, once selected it is removed so that any click actions within the html block will still work. |
html={ attributes.content } | ||
styles={ styles } | ||
/> | ||
{ ! this.props.isSelected && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe add a comment explaining why the overlay is needed (browser issue)
886fa69
to
910dc7b
Compare
In Firefox, if an html block is left in preview mode, it is very difficult to reselect the block except by clicking on the very bottom edge of the block - https://share.getcloudapp.com/9ZuArmrd.
It appears that the click events are not bubbling up from the sandboxed iframe, and the selection works on the bottom edge due to some padding/margin which is outside the extents of the iframe.
Fixes #12577
Description
This PR adds an overlay which covers the html preview area in order to prevent clicks being trapped in the sandboxed iframe
Before:
After:
How has this been tested?
Tested manually in Firefox and Chrome.
Types of changes
Adds additional HTML and CSS to html block
Checklist: