mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-10 12:57:46 +00:00
[UwU] Fix invalid <Select> popover IDs (#748)
- Removes `id`, `aria-labelledby`, and `aria-describedby` attributes from the props returned from `react-aria` within its `<Popover>` component #741
This commit is contained in:
@@ -135,6 +135,11 @@ function ListBox(props: ListBoxProps) {
|
|||||||
const { listBoxRef = ref, state } = props;
|
const { listBoxRef = ref, state } = props;
|
||||||
const { listBoxProps } = useListBox(props, state, listBoxRef);
|
const { listBoxProps } = useListBox(props, state, listBoxRef);
|
||||||
|
|
||||||
|
// As this is inside a portal (within <Popover>), nothing from Preact's useId can be trusted
|
||||||
|
// ...but nothing should be using these IDs anyway.
|
||||||
|
listBoxProps["id"] = undefined;
|
||||||
|
listBoxProps["aria-labelledby"] = undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul {...listBoxProps} ref={listBoxRef} class={styles.optionsList}>
|
<ul {...listBoxProps} ref={listBoxRef} class={styles.optionsList}>
|
||||||
{[...state.collection].map((item) => (
|
{[...state.collection].map((item) => (
|
||||||
@@ -159,6 +164,11 @@ export function Option({ item, state }: OptionProps) {
|
|||||||
ref,
|
ref,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// As this is inside a portal (within <Popover>), nothing from Preact's useId can be trusted
|
||||||
|
// ...but nothing should be using these IDs anyway.
|
||||||
|
optionProps["aria-labelledby"] = undefined;
|
||||||
|
optionProps["aria-describedby"] = undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
{...optionProps}
|
{...optionProps}
|
||||||
|
|||||||
Reference in New Issue
Block a user