@vaadin/vaadin-overlay
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -14,3 +14,3 @@ { | ||
"name": "@vaadin/vaadin-overlay", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"main": "vaadin-overlay.js", | ||
@@ -42,3 +42,6 @@ "author": "Vaadin Ltd", | ||
}, | ||
"devDependencies": { | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"devDependencies": { | ||
"@vaadin/vaadin-demo-helpers": "^3.0.0", | ||
@@ -45,0 +48,0 @@ "@polymer/iron-component-page": "^4.0.0", |
@@ -156,4 +156,4 @@ /** | ||
* | ||
* @memberof Vaadin | ||
* @mixes Vaadin.ThemableMixin | ||
* @extends PolymerElement | ||
* @mixes ThemableMixin | ||
* @demo demo/index.html | ||
@@ -579,3 +579,6 @@ */ | ||
const handler = `__${type}Handler`; | ||
const listener = () => { | ||
const listener = event => { | ||
if (event && event.target !== this) { | ||
return; | ||
} | ||
callback(); | ||
@@ -601,11 +604,11 @@ this.removeEventListener('animationend', listener); | ||
this._attachOverlay(); | ||
if (!this.modeless) { | ||
this._enterModalState(); | ||
} | ||
this.setAttribute('opening', ''); | ||
const finishOpening = () => { | ||
this.removeAttribute('opening'); | ||
document.addEventListener('iron-overlay-canceled', this._boundIronOverlayCanceledListener); | ||
if (!this.modeless) { | ||
this._enterModalState(); | ||
} | ||
this.removeAttribute('opening'); | ||
}; | ||
@@ -632,26 +635,25 @@ | ||
if (this._placeholder) { | ||
this._exitModalState(); | ||
if (this.restoreFocusOnClose && this.__restoreFocusNode) { | ||
// If the activeElement is `<body>` or inside the overlay, | ||
// we are allowed to restore the focus. In all the other | ||
// cases focus might have been moved elsewhere by another | ||
// component or by the user interaction (e.g. click on a | ||
// button outside the overlay). | ||
const activeElement = this._getActiveElement(); | ||
if (activeElement === document.body || this._deepContains(activeElement)) { | ||
this.__restoreFocusNode.focus(); | ||
} | ||
this.__restoreFocusNode = null; | ||
} | ||
this.setAttribute('closing', ''); | ||
const finishClosing = () => { | ||
this.shadowRoot.querySelector('[part="overlay"]').style.removeProperty('pointer-events'); | ||
this._exitModalState(); | ||
document.removeEventListener('iron-overlay-canceled', this._boundIronOverlayCanceledListener); | ||
this._detachOverlay(); | ||
this.shadowRoot.querySelector('[part="overlay"]').style.removeProperty('pointer-events'); | ||
this.removeAttribute('closing'); | ||
if (this.restoreFocusOnClose && this.__restoreFocusNode) { | ||
// If the activeElement is `<body>` or inside the overlay, | ||
// we are allowed to restore the focus. In all the other | ||
// cases focus might have been moved elsewhere by another | ||
// component or by the user interaction (e.g. click on a | ||
// button outside the overlay). | ||
const activeElement = this._getActiveElement(); | ||
if (activeElement === document.body || this._deepContains(activeElement)) { | ||
this.__restoreFocusNode.focus(); | ||
} | ||
this.__restoreFocusNode = null; | ||
} | ||
}; | ||
@@ -677,3 +679,3 @@ | ||
return Array.from(document.body.children) | ||
.filter(el => el instanceof OverlayElement) | ||
.filter(el => el instanceof OverlayElement && !el.hasAttribute('closing')) | ||
.sort((a, b) => (a.__zIndex - b.__zIndex) || 0); | ||
@@ -720,3 +722,3 @@ } | ||
OverlayElement.__attachedInstances.forEach(el => { | ||
if (el !== this && !el.hasAttribute('opening') && !el.hasAttribute('closing')) { | ||
if (el !== this) { | ||
el.shadowRoot.querySelector('[part="overlay"]').style.pointerEvents = 'none'; | ||
@@ -723,0 +725,0 @@ } |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
58574
1218