mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
chore: add accessible name to the icon button (#3300)
This commit is contained in:
parent
069163053f
commit
edd48a09cc
6
.changeset/great-avocados-eat.md
Normal file
6
.changeset/great-avocados-eat.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@nextui-org/chip": patch
|
||||
"@nextui-org/input": patch
|
||||
---
|
||||
|
||||
Add accessible name to the icon button (#2802, #2808)
|
||||
@ -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" />
|
||||
) : (
|
||||
|
||||
@ -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),
|
||||
};
|
||||
};
|
||||
|
||||
@ -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)}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user