hsuanyi-chou / shadcn-ui-expansions

More components built on top of shadcn-ui.
https://shadcnui-expansions.typeart.cc/
MIT License
1.1k stars 51 forks source link

Fix disabled styles applied on badged selected items when disabled:false #83

Closed Unsleeping closed 6 months ago

Unsleeping commented 6 months ago

This pull request addresses an issue encountered with the badge component. Following selection, the badge item exhibits disabled styles, despite the disabled:false property being set.

Investigation revealed that the presence of data-disabled="false" in the HTML attribute triggers unintended tailwind rules (.data-\[disabled\]). This behavior, which was not previously observed, arose unexpectedly after a period of time.

This update aims to rectify the styling inconsistency by refining JSX configuration to prevent the unintended application of styles to elements when disabled: false

Screenshot 2024-05-14 at 21 06 53

In my case, I used the MultipleSelector component with the canEdit property set to true, thus ensuring that disabled was false. You can confirm this by referring to the screenshot above, where you can see data-disabled="false" in the HTML attribute of the selected item.

Screenshot 2024-05-14 at 21 12 19
netlify[bot] commented 6 months ago

Deploy Preview for shadcnui-expansions ready!

Name Link
Latest commit 3c873e45ea80d1cd86ddbf881ad3ab7b8d8f1743
Latest deploy log https://app.netlify.com/sites/shadcnui-expansions/deploys/6643a77efcd96b000783c858
Deploy Preview https://deploy-preview-83--shadcnui-expansions.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.