@springernature/global-popup
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -15,3 +15,3 @@ import {Popup} from '../js/popup'; | ||
<p>Some popup text</p> | ||
</div> | ||
</div> | ||
`; | ||
@@ -72,3 +72,3 @@ trigger = document.querySelector('[data-test-trigger]'); | ||
const closeBtn = getCloseBtn(); | ||
const event = new KeyboardEvent('keydown', {key: 'Space'}); | ||
const event = new KeyboardEvent('keydown', {key: ' '}); | ||
closeBtn.dispatchEvent(event); | ||
@@ -148,3 +148,3 @@ | ||
<p>Some popup text</p> | ||
</div> | ||
</div> | ||
`; | ||
@@ -151,0 +151,0 @@ document.body.appendChild(html); |
# History | ||
## 0.4.2 (2020-07-29) | ||
* Bump global-expander to 2.0.2 | ||
* Bump global-javascript to 2.3.0 | ||
* Set AUTOFOCUS: target to retain behaviour from previous version (1.2.0) | ||
* Close button changes | ||
* Fix unable to reach close button | ||
* Fix keyboard space key not closing popup and update test | ||
* Replace <a> with <button> on close button | ||
## 0.4.1 (2020-07-20) | ||
@@ -4,0 +13,0 @@ * Updates close icon to global icon set |
@@ -10,6 +10,6 @@ import {Expander} from '@springernature/global-expander/js/expander'; | ||
this._isOpen = false; | ||
this._expander = new Expander(this._trigger, this._content, {FOCUS_EVENT: true}); | ||
this._arrowClass = `${this._className}__arrow`; | ||
this._closeClass = `${this._className}__close`; | ||
this._closeButton = `<a href="javascript:;" class="${this._closeClass}">Close</a>`; | ||
this._closeTextClass = `${this._className}__close-text`; | ||
this._closeButton = `<button class="${this._closeClass}"><span class="${this._closeTextClass}">Close</span></button>`; | ||
this._arrow = `<div class="${this._arrowClass}"></div>`; | ||
@@ -20,2 +20,3 @@ this._closeHandler = () => { | ||
this._build(); | ||
this._expander = new Expander(this._trigger, this._content, {AUTOFOCUS: 'target', FOCUS_EVENT: true, CLOSE_EVENT: true}); | ||
this._bindEvents(); | ||
@@ -57,2 +58,3 @@ } | ||
event.preventDefault(); | ||
if (this._isOpen) { | ||
@@ -71,5 +73,6 @@ return; | ||
this._getCloseButton().addEventListener('keydown', event => { | ||
if (event.key === 'Enter' || event.key === 'Space') { | ||
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') { | ||
event.preventDefault(); | ||
this._close(); | ||
this._trigger.focus(); | ||
} | ||
@@ -82,2 +85,3 @@ }); | ||
this._close(); | ||
this._trigger.focus(); | ||
} | ||
@@ -84,0 +88,0 @@ }); |
{ | ||
"name": "@springernature/global-popup", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Builds and styles a popup that can be opened and closed", | ||
@@ -10,5 +10,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"@springernature/global-javascript": "^2.1.0", | ||
"@springernature/global-expander": "^1.2.0" | ||
"@springernature/global-javascript": "^2.3.0", | ||
"@springernature/global-expander": "^2.0.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15610
287
+ Added@springernature/global-expander@2.1.0(transitive)
- Removed@springernature/global-expander@1.2.0(transitive)