Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terra-slide-panel

Package Overview
Dependencies
Maintainers
7
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-slide-panel - npm Package Compare versions

Comparing version 3.38.0 to 3.38.1

5

CHANGELOG.md

@@ -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 @@

13

lib/SlidePanel.js

@@ -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();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc