Skip to content

Commit

Permalink
fix: add aria-controls
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Nov 7, 2023
1 parent 3c702d0 commit 4671ee7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/lovely-students-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@zag-js/color-picker": patch
"@zag-js/date-picker": patch
---

Fix issue where `aria-controls` was not added to trigger
1 change: 1 addition & 0 deletions packages/machines/color-picker/src/color-picker.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
...parts.trigger.attrs,
id: dom.getTriggerId(state.context),
dir: state.context.dir,
"aria-controls": dom.getContentId(state.context),
"aria-labelledby": dom.getLabelId(state.context),
"data-disabled": dataAttr(isDisabled),
"data-readonly": dataAttr(state.context.readOnly),
Expand Down
1 change: 1 addition & 0 deletions packages/machines/date-picker/src/date-picker.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
type: "button",
"data-placement": currentPlacement,
"aria-label": isOpen ? "Close calendar" : "Open calendar",
"aria-controls": dom.getContentId(state.context),
"data-state": isOpen ? "open" : "closed",
"aria-haspopup": "grid",
disabled,
Expand Down

4 comments on commit 4671ee7

@vercel
Copy link

@vercel vercel bot commented on 4671ee7 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-two.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app
zag-nextjs-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4671ee7 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 4671ee7 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue.vercel.app
zag-vue-chakra-ui.vercel.app
zag-vue-git-main-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4671ee7 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-chakra-ui.vercel.app
zag-solid.vercel.app
zag-solid-git-main-chakra-ui.vercel.app

Please sign in to comment.