terra-slide-panel
Advanced tools
Comparing version 3.38.0 to 3.38.1
@@ -5,2 +5,7 @@ # Changelog | ||
## 3.38.1 - (April 12, 2023) | ||
* Fixed | ||
* Fixed bug where `terra-slide-panel` crashes when open by default on load. | ||
## 3.38.0 - (March 29, 2023) | ||
@@ -7,0 +12,0 @@ |
@@ -98,6 +98,13 @@ "use strict"; | ||
this.panelNode.focus(); | ||
} else if (!this.props.isOpen && this.props.isOpen !== prevProps.isOpen) { | ||
// Return focus to the disclosing element | ||
this.disclosingNode.focus(); | ||
return; | ||
} | ||
if (!this.props.isOpen && this.props.isOpen !== prevProps.isOpen) { | ||
if (this.disclosingNode) { | ||
// Return focus to the disclosing element | ||
this.disclosingNode.focus(); | ||
return; | ||
} | ||
// The disclosing element doesn't exist and return focus to the main div | ||
this.mainNode.current.focus(); | ||
} | ||
} | ||
@@ -104,0 +111,0 @@ }, { |
{ | ||
"name": "terra-slide-panel", | ||
"main": "lib/SlidePanel.js", | ||
"version": "3.38.0", | ||
"version": "3.38.1", | ||
"description": "The Terra SlidePanel component is a progressive disclosure mechanism that allows additional content to be shown and hidden in a variety of ways.", | ||
@@ -47,3 +47,3 @@ "repository": { | ||
}, | ||
"gitHead": "9075a61ed186b64f553fdfc6035df63a657999dd" | ||
"gitHead": "78fd244b38c1eef125107438fa38d50dd668a16c" | ||
} |
@@ -87,6 +87,14 @@ import React from 'react'; | ||
this.panelNode.focus(); | ||
} else if (!this.props.isOpen && this.props.isOpen !== prevProps.isOpen) { | ||
// Return focus to the disclosing element | ||
this.disclosingNode.focus(); | ||
return; | ||
} | ||
if (!this.props.isOpen && this.props.isOpen !== prevProps.isOpen) { | ||
if (this.disclosingNode) { | ||
// Return focus to the disclosing element | ||
this.disclosingNode.focus(); | ||
return; | ||
} | ||
// The disclosing element doesn't exist and return focus to the main div | ||
this.mainNode.current.focus(); | ||
} | ||
} | ||
@@ -93,0 +101,0 @@ |
@@ -170,2 +170,12 @@ const context = '[data-terra-dev-site-content] *:first-child'; | ||
}); | ||
describe('Panel is open by default on page load', () => { | ||
it('Closes panel and focuses on main div', () => { | ||
browser.url('/raw/tests/cerner-terra-framework-docs/slide-panel/slide-panel-toggled-on'); | ||
$('#toggle-panel-button').click(); | ||
expect($('[aria-label="Main content area"]').isFocused()).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
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
60245
573