Skip to content

Commit

Permalink
fix(navlist.item): Add disabled attribute to disabled NavList.Item …
Browse files Browse the repository at this point in the history
…component (#2723)

* fix: add disabled attribute to disabled NavList.Item component

* chore: storybook typo

* chore: add changeset
  • Loading branch information
colomolo committed Apr 30, 2024
1 parent 52cd64f commit 974f1e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/selfish-icons-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@contentful/f36-components': patch
---

Add disabled attribute to NavList.Item when isDisabled is passed
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function _NavListItem<
ref={ref}
data-test-id={itemTestId}
tabIndex={isDisabled ? -1 : 0}
disabled={isDisabled}
>
{props.children}
</Element>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/navlist/stories/NavList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const WithActiveAndDisable: Story<NavListProps> = (args) => {
);
};

export const Controled: Story<NavListProps> = (args) => {
export const Controlled: Story<NavListProps> = (args) => {
const [active, setActive] = useState(0);
const handleOnClick = (id) => () => {
setActive(id);
Expand Down

0 comments on commit 974f1e0

Please sign in to comment.