terra-button
Advanced tools
Comparing version 3.48.0 to 3.49.0
@@ -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 @@ |
{ | ||
"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' }); | ||
}); | ||
}); | ||
}); |
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
216046
74
2298