Skip to content

Commit

Permalink
chore: add accessible name to the icon button (#3300)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-manba authored Jun 23, 2024
1 parent 0691630 commit edd48a0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/great-avocados-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/chip": patch
"@nextui-org/input": patch
---

Add accessible name to the icon button (#2802, #2808)
2 changes: 1 addition & 1 deletion apps/docs/content/components/input/password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function App() {
variant="bordered"
placeholder="Enter your password"
endContent={
<button className="focus:outline-none" type="button" onClick={toggleVisibility}>
<button className="focus:outline-none" type="button" onClick={toggleVisibility} aria-label="toggle password visibility">
{isVisible ? (
<EyeSlashFilledIcon className="text-2xl text-default-400 pointer-events-none" />
) : (
Expand Down
1 change: 1 addition & 0 deletions packages/components/chip/src/use-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export function useChip(originalProps: UseChipProps) {
role: "button",
tabIndex: 0,
className: slots.closeButton({class: classNames?.closeButton}),
"aria-label": "close chip",
...mergeProps(closePressProps, closeFocusProps),
};
};
Expand Down
1 change: 1 addition & 0 deletions packages/components/input/src/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
...props,
role: "button",
tabIndex: 0,
"aria-label": "clear input",
"data-slot": "clear-button",
"data-focus-visible": dataAttr(isClearButtonFocusVisible),
className: slots.clearButton({class: clsx(classNames?.clearButton, props?.className)}),
Expand Down

0 comments on commit edd48a0

Please sign in to comment.