From a496cb8be4dd1ccd4610e06f425153c76defc594 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Tue, 16 Feb 2016 14:16:27 +0000 Subject: Focus (visually hidden) input radio/checkbox This allows for keyboard navigation (e.g. arrow keys left/right to trigger different radio buttons) following an initial mouse click interaction --- js/src/button.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/src') diff --git a/js/src/button.js b/js/src/button.js index 3144a3f10..adcf4c928 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -92,7 +92,10 @@ const Button = (($) => { input.checked = !$(this._element).hasClass(ClassName.ACTIVE) $(this._element).trigger('change') } + + $(input).trigger('focus') } + } else { this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)) -- cgit v1.2.3 From 701b12bf5823769e4eae66153755cf1ecd10ead9 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Wed, 17 Feb 2016 15:21:02 +0000 Subject: Replace jQuery with vanilla JS --- js/src/button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src') diff --git a/js/src/button.js b/js/src/button.js index adcf4c928..39e2b3974 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -93,7 +93,7 @@ const Button = (($) => { $(this._element).trigger('change') } - $(input).trigger('focus') + input.focus() } } else { -- cgit v1.2.3 From afdd62d1616f201b19766fc4c63a888690044145 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 21 Apr 2016 01:15:22 -0700 Subject: Modal: Remove IE8-specific window.innerWidth workaround [skip validator] --- js/src/modal.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'js/src') diff --git a/js/src/modal.js b/js/src/modal.js index 202c5fe94..e2365aca7 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -408,13 +408,7 @@ const Modal = (($) => { } _checkScrollbar() { - let fullWindowWidth = window.innerWidth - if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 - let documentElementRect = document.documentElement.getBoundingClientRect() - fullWindowWidth = - documentElementRect.right - Math.abs(documentElementRect.left) - } - this._isBodyOverflowing = document.body.clientWidth < fullWindowWidth + this._isBodyOverflowing = document.body.clientWidth < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } -- cgit v1.2.3 From b107e3342a761aa94b7827436264469d5630eaec Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Tue, 10 May 2016 23:53:49 +0100 Subject: Handle aria-hidden on modal container when showing/hiding Fixes #19878 --- js/src/modal.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/src') diff --git a/js/src/modal.js b/js/src/modal.js index e2365aca7..695ac569b 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -223,6 +223,7 @@ const Modal = (($) => { } this._element.style.display = 'block' + this._element.removeAttribute('aria-hidden') this._element.scrollTop = 0 if (transition) { @@ -290,6 +291,7 @@ const Modal = (($) => { _hideModal() { this._element.style.display = 'none' + this._element.setAttribute('aria-hidden', 'true') this._showBackdrop(() => { $(document.body).removeClass(ClassName.OPEN) this._resetAdjustments() -- cgit v1.2.3