@cfpb/cfpb-expandables
Advanced tools
Comparing version 0.21.6 to 0.21.7
{ | ||
"name": "@cfpb/cfpb-expandables", | ||
"version": "0.21.6", | ||
"version": "0.21.7", | ||
"description": "Design System expandables", | ||
@@ -19,4 +19,4 @@ "main": "src/cfpb-expandables.js", | ||
], | ||
"gitHead": "8b3bcf2570ddb04cf1b25296da34e8f67933f424", | ||
"gitHead": "c2388caf3b8139993afaf8f7a61bfeb0eea85eb2", | ||
"type": "module" | ||
} |
@@ -50,4 +50,2 @@ /* eslint-disable no-use-before-define */ | ||
_dom.classList.add(`${BASE_CLASS}__loading`); | ||
// Don't initialize the Summary till the page has loaded, so we can have | ||
@@ -89,3 +87,3 @@ // an accurate idea of its height. | ||
_dom.addEventListener('focusin', _keyDownHandler); | ||
_dom.addEventListener('focusin', _focusInHandler); | ||
@@ -97,4 +95,2 @@ /* When we click inside the content area we may be changing the size, | ||
_contentDom.addEventListener('click', _contentClicked); | ||
_dom.classList.remove(`${BASE_CLASS}__loading`); | ||
} | ||
@@ -104,7 +100,8 @@ | ||
* | ||
* @param {KeyboardEvent} evt - The key down event. | ||
* @param {Event} evt - The focus event. | ||
*/ | ||
function _keyDownHandler(evt) { | ||
if ((evt.key = 'Tab' && evt.target !== _btnDom)) { | ||
function _focusInHandler(evt) { | ||
if (!_suspended && evt.target !== _btnDom) { | ||
_btnDom.click(); | ||
_dom.removeEventListener('focusin', _focusInHandler); | ||
} | ||
@@ -144,4 +141,4 @@ } | ||
/* Bail out of initializatiion if the height of the summary's content | ||
is less than our summary height of 5.5ems + 4px padding | ||
16 * 5.5 = 88 + 4 = 92 | ||
is less than our summary height of 5.5ems | ||
16 * 5.5 = 88 | ||
See https://github.com/cfpb/design-system/blob/72623270013f2ad08dbe92b5b709ed2b434ee41e/packages/cfpb-atomic-component/src/utilities/transition/transition.less#L84 | ||
@@ -151,3 +148,3 @@ */ | ||
(_hasMobileModifier && !viewportIsIn(MOBILE)) || | ||
_contentDom.scrollHeight <= 92 | ||
_contentDom.scrollHeight <= 88 | ||
); | ||
@@ -154,0 +151,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59974
444