terra-button
Advanced tools
Comparing version 3.63.0 to 3.64.0
@@ -5,2 +5,7 @@ # Changelog | ||
## 3.64.0 - (February 16, 2023) | ||
* Changed | ||
* Fixed aria-label bug. | ||
## 3.63.0 - (February 15, 2023) | ||
@@ -7,0 +12,0 @@ |
@@ -338,5 +338,5 @@ "use strict"; | ||
// ignore aria-label for button with decorative icons. | ||
var ariaLabel = iconType !== IconTypes.DECORATIVE ? customProps['aria-label'] : undefined; | ||
if ((isIconOnly || variant === 'utility') && iconType === IconTypes.INFORMATIVE) { | ||
ariaLabel = ariaLabel || text; | ||
var ariaLabel = customProps['aria-label']; | ||
if (isIconOnly || variant === 'utility') { | ||
ariaLabel = iconType === IconTypes.INFORMATIVE ? ariaLabel || text : undefined; | ||
} | ||
@@ -343,0 +343,0 @@ var ComponentType = 'button'; |
{ | ||
"name": "terra-button", | ||
"main": "lib/Button.js", | ||
"version": "3.63.0", | ||
"version": "3.64.0", | ||
"description": "The terra-button component provides users a way to trigger actions in the UI.", | ||
@@ -47,3 +47,3 @@ "repository": { | ||
}, | ||
"gitHead": "632d9cecc4c480d250ddef2ee6999349eda97641" | ||
"gitHead": "76b62237054bafffe2e51240370bc7cd0cf6df81" | ||
} |
@@ -311,5 +311,5 @@ import React from 'react'; | ||
// ignore aria-label for button with decorative icons. | ||
let ariaLabel = (iconType !== IconTypes.DECORATIVE) ? customProps['aria-label'] : undefined; | ||
if ((isIconOnly || variant === 'utility') && iconType === IconTypes.INFORMATIVE) { | ||
ariaLabel = ariaLabel || text; | ||
let ariaLabel = customProps['aria-label']; | ||
if (isIconOnly || variant === 'utility') { | ||
ariaLabel = (iconType === IconTypes.INFORMATIVE) ? ariaLabel || text : undefined; | ||
} | ||
@@ -316,0 +316,0 @@ |
import React from 'react'; | ||
import ThemeContextProvider from 'terra-theme-context/lib/ThemeContextProvider'; | ||
import Button from '../../src/Button'; | ||
import Button, { IconTypes } from '../../src/Button'; | ||
@@ -52,5 +52,5 @@ // Snapshot Tests | ||
it('should render an icon', () => { | ||
it('should render an informative icon button', () => { | ||
const testElement = <img alt="icon" />; | ||
const button = shallow(<Button icon={testElement} isIconOnly text="isIconOnly" />); | ||
const button = shallow(<Button iconType={IconTypes.INFORMATIVE} icon={testElement} isIconOnly text="isIconOnly" />); | ||
expect(button).toMatchSnapshot(); | ||
@@ -57,0 +57,0 @@ }); |
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
148499