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

terra-button

Package Overview
Dependencies
Maintainers
9
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-button - npm Package Compare versions

Comparing version 3.48.0 to 3.49.0

lib/terra-dev-site/test/button/ProgrammaticDisableEnable.test.js

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## 3.49.0 - (November 10, 2020)
* Fixed
* Fixed focus styles issue after re-enabling a disabled button.
## 3.48.0 - (October 27, 2020)

@@ -7,0 +12,0 @@

@@ -406,2 +406,13 @@ "use strict";

}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
if (prevState.focused && nextProps.isDisabled) {
return {
focused: false
};
}
return null;
}
}]);

@@ -408,0 +419,0 @@

4

package.json
{
"name": "terra-button",
"main": "lib/Button.js",
"version": "3.48.0",
"version": "3.49.0",
"description": "The terra-button component provides users a way to trigger actions in the UI.",

@@ -48,3 +48,3 @@ "repository": {

},
"gitHead": "6e29f8f1dad526259a02fea6a926fb6545998098"
"gitHead": "1b981da7df893b44257a6fbffb2cbaccc6714b97"
}

@@ -131,2 +131,9 @@ import React from 'react';

static getDerivedStateFromProps(nextProps, prevState) {
if (prevState.focused && nextProps.isDisabled) {
return { focused: false };
}
return null;
}
handleOnBlur(event) {

@@ -133,0 +140,0 @@ this.setState({ focused: false });

@@ -240,2 +240,20 @@ Terra.describeViewports('Button', ['tiny'], () => {

});
describe('Programmatically Re-enable a disabled button', () => {
before(() => {
browser.url('/#/raw/tests/terra-button/button/programmatic-disable-enable');
});
it('disables button', () => {
browser.keys(['Tab']);
browser.click('#programmaticDisabledButton1');
Terra.validates.element('Button is disabled', { selector: '#root' });
});
it('enables button', () => {
browser.keys(['Tab']);
browser.click('#programmaticDisabledButton2');
Terra.validates.element('Enabled Button is not focused', { selector: '#root' });
});
});
});
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