Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ariakit/src/input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const TextInput = forwardRef<
onChange,
onSubmit,
autoComplete,
"aria-activedescendant": ariaActivedescendant,
rightSection,
...rest
} = props;
Expand Down Expand Up @@ -52,6 +53,7 @@ export const TextInput = forwardRef<
onChange={onChange}
onSubmit={onSubmit}
autoComplete={autoComplete}
aria-activedescendant={ariaActivedescendant}
/>
{rightSection}
</div>
Expand Down
2 changes: 2 additions & 0 deletions packages/mantine/src/form/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const TextInput = forwardRef<
onChange,
onSubmit,
autoComplete,
"aria-activedescendant": ariaActivedescendant,
rightSection,
...rest
} = props;
Expand Down Expand Up @@ -49,6 +50,7 @@ export const TextInput = forwardRef<
onChange={onChange}
onSubmit={onSubmit}
autoComplete={autoComplete}
aria-activedescendant={ariaActivedescendant}
/>
);
});
1 change: 1 addition & 0 deletions packages/react/src/editor/ComponentsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export type ComponentProps = {
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
onSubmit?: () => void;
autoComplete?: HTMLInputAutoCompleteAttribute;
"aria-activedescendant"?: string;
};
};
Menu: {
Expand Down
2 changes: 2 additions & 0 deletions packages/shadcn/src/form/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const TextInput = forwardRef<
onChange,
onSubmit,
autoComplete,
"aria-activedescendant": ariaActivedescendant,
rightSection, // TODO: add rightSection
...rest
} = props;
Expand Down Expand Up @@ -58,6 +59,7 @@ export const TextInput = forwardRef<
onChange={onChange}
onSubmit={onSubmit}
ref={ref}
aria-activedescendant={ariaActivedescendant}
/>
</div>
{rightSection}
Expand Down
6 changes: 6 additions & 0 deletions packages/xl-ai/src/components/AIMenu/PromptSuggestionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {
const { selectedIndex, setSelectedIndex, handler } =
useSuggestionMenuKeyboardHandler(items, (item) => item.onItemClick());

const activeDescendantId =
items.length > 0 && selectedIndex >= 0 && selectedIndex < items.length
? `bn-suggestion-menu-item-${selectedIndex}`
: undefined;

const handleKeyDown = useCallback(
(event: KeyboardEvent) => {
// TODO: handle backspace to close
Expand Down Expand Up @@ -107,6 +112,7 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {
onChange={handleChange}
autoComplete={"off"}
rightSection={props.rightSection}
aria-activedescendant={activeDescendantId}
/>
</Components.Generic.Form.Root>
<Components.SuggestionMenu.Root
Expand Down
Loading