commit
be3ffc1f96
@ -118,7 +118,7 @@ class Fullscreen {
|
|||||||
|
|
||||||
const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.property}Element`];
|
const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.property}Element`];
|
||||||
|
|
||||||
return element === this.target;
|
return (element && element.shadowRoot) ? element === this.target.getRootNode().host : element === this.target;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get target element
|
// Get target element
|
||||||
|
@ -221,7 +221,7 @@ export function hasClass(element, className) {
|
|||||||
|
|
||||||
// Element matches selector
|
// Element matches selector
|
||||||
export function matches(element, selector) {
|
export function matches(element, selector) {
|
||||||
const prototype = { Element };
|
const prototype = Element.prototype;
|
||||||
|
|
||||||
function match() {
|
function match() {
|
||||||
return Array.from(document.querySelectorAll(selector)).includes(this);
|
return Array.from(document.querySelectorAll(selector)).includes(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user