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

@leafygreen-ui/button

Package Overview
Dependencies
Maintainers
6
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/button - npm Package Compare versions

Comparing version 21.0.3 to 21.0.4

29

CHANGELOG.md
# @leafygreen-ui/button
## 21.0.4
### Patch Changes
- db014722: Retroactively updates changeset notes around reason to update Button from using `disabled` to `aria-disabled` under the hood. See details at version 20.0.0
## 21.0.3

@@ -195,4 +201,25 @@

- 1cff328a3: No longer sets `pointer-events: "none"` when Button components are disabled.
- 1cff328a3: Disabled buttons no longer render the `disabled` attribute, but rely on `aria-disabled`. They also no longer set `pointer-events: "none"` in their styles. `onClick` events are explicitly prevented within the component to maintain functionality.
This change was made to ensure that:
1. Disabled buttons are still focusable to users when navigating via the `Tab` key, and
2. Disabled buttons are valid triggers for a `Tooltip`.
For more on `aria-disabled` see the [documentation on MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled)
#### Migration guide
Functionally, migration from v19 to v20 should be seamless, however there may be unit/integration/e2e tests that relied on this behavior.
##### Jest/RTL
Generally, only this repo should need to test that the button has a specific attribute. If possible, we recommend changing unit tests to check that some event was or was not called.
However there are cases where this still needs to be tested. To change this, replace any `expect(button).toBeDisabled()` with an explicit check for `expect(button).toHaveAttribute("aria-disabled", "true")`.
##### Cypress
Similarly to unit tests, you should generally test functionality, not implementation details. However, to test this in Cypress replace any `cy.get(button).should('be.disabled');` checks with `cy.get(button).invoke('attr', 'aria-disabled').should('eq', 'true');`
### Patch Changes

@@ -199,0 +226,0 @@

2

package.json
{
"name": "@leafygreen-ui/button",
"version": "21.0.3",
"version": "21.0.4",
"description": "leafyGreen UI Kit Button",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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