Socket
Socket
Sign inDemoInstall

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.39.0 to 3.40.0

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

5

CHANGELOG.md

@@ -7,2 +7,7 @@ ChangeLog

3.40.0 - (June 2, 2020)
------------------
### Fixed
* Fixed button not losing `focus` and `active` styles when made disabled via user interaction.
3.39.0 - (May 19, 2020)

@@ -9,0 +14,0 @@ ------------------

8

lib/Button.js

@@ -46,3 +46,3 @@ "use strict";

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

@@ -338,5 +338,5 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

}, {
'is-active': this.state.active
'is-active': this.state.active && !isDisabled
}, {
'is-focused': this.state.focused
'is-focused': this.state.focused && !isDisabled
}, theme.className]), customProps.className);

@@ -364,3 +364,3 @@ var buttonLabelClasses = cx(['button-label', {

var cloneIcon = _react.default.cloneElement(icon, {
var cloneIcon = /*#__PURE__*/_react.default.cloneElement(icon, {
className: iconSvgClasses

@@ -367,0 +367,0 @@ });

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

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

},
"gitHead": "a75ebe4bfe9cb09b4d0ab1a5f9c8039ddf2d0add"
"gitHead": "e00edee5a7045d98d91c79d8f20b6720622ae018"
}

@@ -246,4 +246,4 @@ import React from 'react';

{ compact: isCompact },
{ 'is-active': this.state.active },
{ 'is-focused': this.state.focused },
{ 'is-active': this.state.active && !isDisabled },
{ 'is-focused': this.state.focused && !isDisabled },
theme.className,

@@ -250,0 +250,0 @@ ]),

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

});
describe('Programmatic Disabled', () => {
before(() => {
browser.url('/#/raw/tests/terra-button/button/programmatic-disabled');
});
it('focuses button', () => {
browser.keys(['Tab']);
});
Terra.it.validatesElement('Button has focus', { selector: '#root' });
it('disables button', () => {
browser.click('#programmaticDisabledButton');
});
Terra.it.validatesElement('Button is Disabled', { 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