mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix: make VisuallyHidden's element type as span when it's inside phrasing element (#3013)
* fix(checkbox): make VisuallyHidden's element type as span * feat(changeset): add changeset * fix(radio): make the VisuallyHidden element type as span * fix(switch): make the VisuallyHidden element type as span * fix(select): make the VisuallyHidden element type as span * feat(changeset): replace changeset * chore: fix formatting
This commit is contained in:
parent
0108d06d3b
commit
06ecd213cf
8
.changeset/thick-frogs-jog.md
Normal file
8
.changeset/thick-frogs-jog.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
"@nextui-org/checkbox": patch
|
||||
"@nextui-org/radio": patch
|
||||
"@nextui-org/select": patch
|
||||
"@nextui-org/switch": patch
|
||||
---
|
||||
|
||||
make the VisuallyHidden `elementType` as span when the default parent element accepts only phrasing elements
|
||||
@ -26,7 +26,7 @@ const Checkbox = forwardRef<"input", CheckboxProps>((props, ref) => {
|
||||
|
||||
return (
|
||||
<Component {...getBaseProps()}>
|
||||
<VisuallyHidden>
|
||||
<VisuallyHidden elementType="span">
|
||||
<input {...getInputProps()} />
|
||||
</VisuallyHidden>
|
||||
<span {...getWrapperProps()}>{clonedIcon}</span>
|
||||
|
||||
@ -22,7 +22,7 @@ const Radio = forwardRef<"input", RadioProps>((props, ref) => {
|
||||
|
||||
return (
|
||||
<Component {...getBaseProps()}>
|
||||
<VisuallyHidden>
|
||||
<VisuallyHidden elementType="span">
|
||||
<input {...getInputProps()} />
|
||||
</VisuallyHidden>
|
||||
<span {...getWrapperProps()}>
|
||||
|
||||
@ -130,7 +130,9 @@ function Select<T extends object>(props: Props<T>, ref: ForwardedRef<HTMLSelectE
|
||||
<div {...getInnerWrapperProps()}>
|
||||
{startContent}
|
||||
<span {...getValueProps()}>{renderSelectedItem}</span>
|
||||
{endContent && state.selectedItems && <VisuallyHidden>,</VisuallyHidden>}
|
||||
{endContent && state.selectedItems && (
|
||||
<VisuallyHidden elementType="span">,</VisuallyHidden>
|
||||
)}
|
||||
{endContent}
|
||||
</div>
|
||||
{renderIndicator}
|
||||
|
||||
@ -35,7 +35,7 @@ const Switch = forwardRef<"input", SwitchProps>((props, ref) => {
|
||||
|
||||
return (
|
||||
<Component {...getBaseProps()}>
|
||||
<VisuallyHidden>
|
||||
<VisuallyHidden elementType="span">
|
||||
<input {...getInputProps()} />
|
||||
</VisuallyHidden>
|
||||
<span {...getWrapperProps()}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user