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

Block pointer events and focus in embedded content #1114

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion components/html-embed/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Internal dependencies
*/
import './style.scss';

// When embedding HTML from the WP oEmbed proxy, we need to insert it
// into a div and make sure any scripts get run. This component takes
// HTML and puts it into a div element, and creates and adds new script
Expand Down Expand Up @@ -27,7 +32,11 @@ export default class HtmlEmbed extends wp.element.Component {

render() {
return (
<div ref={ ( node ) => this.node = node } />
<div
className="html-embed"
tabIndex="-1"
ref={ ( node ) => this.node = node }
/>
);
}
}
3 changes: 3 additions & 0 deletions components/html-embed/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.html-embed {
pointer-events: none;
}
18 changes: 0 additions & 18 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@
border: 2px solid $blue-medium-200;
}

.iframe-overlay {
position: relative;
}

.iframe-overlay:before {
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}

&.is-selected .iframe-overlay:before {
display: none;
}

// Alignments
&[data-align="left"],
&[data-align="right"] {
Expand Down