-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIP) SearchableMenu with persistent item focus #7248
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LFDanLu
commented
Oct 23, 2024
Comment on lines
+279
to
+283
// arrows because the NVDA blue focus indicator moves into the menu and is only restored back to the input when typing. In Voiceover it works just fine though, | ||
// mobile screen readers don't suffer from this when using virtual keyboards either | ||
// When adding the "auto focus the first item if no items are focused" behavior, the announcement of the letter typed gets cut off a bit in NVDA. | ||
// Ariakit seems to announce a bit better, doesn't interrupt. | ||
// Also it feels like we are pulling in more and more stuff/updating focused key in more places, might be nice if this was more centralized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the announcement behavior in NVDA is actually bit more nuanced that this depending if the newly focused item is the same as before, will need more testing
…utocomplete_retain_always
…utocomplete_retain_always
## API Changes
react-aria-components/react-aria-components:Autocomplete+Autocomplete {
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ children?: ReactNode | ((AutocompleteRenderProps & {
+ defaultChildren: ReactNode | undefined
+})) => ReactNode
+ className?: string | ((AutocompleteRenderProps & {
+ defaultClassName: string | undefined
+})) => string
+ defaultFilter?: (string, string) => boolean
+ defaultInputValue?: string
+ id?: string
+ inputValue?: string
+ isDisabled?: boolean
+ isReadOnly?: boolean
+ name?: string
+ onBlur?: (FocusEvent<HTMLInputElement>) => void
+ onFocus?: (FocusEvent<HTMLInputElement>) => void
+ onFocusChange?: (boolean) => void
+ onInputChange?: (string) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ slot?: string | null
+ style?: CSSProperties | ((AutocompleteRenderProps & {
+ defaultStyle: CSSProperties
+})) => CSSProperties | undefined
+} @react-aria/autocomplete/@react-aria/autocomplete:useAutocomplete+useAutocomplete <T> {
+ props: AriaAutocompleteOptions
+ state: AutocompleteState
+ returnVal: undefined
+} /@react-aria/autocomplete:AriaAutocompleteProps+AriaAutocompleteProps {
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ children: ReactNode
+ defaultInputValue?: string
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ id?: string
+ inputValue?: string
+ isDisabled?: boolean
+ isReadOnly?: boolean
+ label?: ReactNode
+ name?: string
+ onBlur?: (FocusEvent<HTMLInputElement>) => void
+ onFocus?: (FocusEvent<HTMLInputElement>) => void
+ onFocusChange?: (boolean) => void
+ onInputChange?: (string) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholder?: string
+} /@react-aria/autocomplete:AriaAutocompleteOptions+AriaAutocompleteOptions {
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ defaultInputValue?: string
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ id?: string
+ inputRef: RefObject<HTMLInputElement | null>
+ inputValue?: string
+ isDisabled?: boolean
+ isReadOnly?: boolean
+ label?: ReactNode
+ name?: string
+ onBlur?: (FocusEvent<HTMLInputElement>) => void
+ onFocus?: (FocusEvent<HTMLInputElement>) => void
+ onFocusChange?: (boolean) => void
+ onInputChange?: (string) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholder?: string
+} /@react-aria/autocomplete:AutocompleteAria+AutocompleteAria <T> {
+ descriptionProps: DOMAttributes
+ inputProps: InputHTMLAttributes<HTMLInputElement>
+ labelProps: DOMAttributes
+ menuProps: AriaMenuOptions<T>
+ register: ((KeyboardEvent) => string | null) => void
+} @react-aria/collections/@react-aria/collections:BaseCollection BaseCollection <T> {
addNode: (CollectionNode<T>) => void
at: () => Node<T>
clone: () => this
commit: (Key | null, Key | null, any) => void
+ filter: ((string) => boolean) => BaseCollection<T>
getChildren: (Key) => Iterable<Node<T>>
getFirstKey: () => void
getItem: (Key) => Node<T> | null
getKeyAfter: (Key) => void
getKeys: () => void
getLastKey: () => void
removeNode: (Key) => void
size: any
undefined: () => void
} @react-aria/menu/@react-aria/menu:AriaMenuOptions AriaMenuOptions <T> {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
autoFocus?: boolean | FocusStrategy
defaultSelectedKeys?: 'all' | Iterable<Key>
disabledKeys?: Iterable<Key>
disallowEmptySelection?: boolean
id?: string
isVirtualized?: boolean
items?: Iterable<T>
keyboardDelegate?: KeyboardDelegate
onAction?: (Key) => void
onClose?: () => void
+ onHoverStart?: (HoverEvent) => void
onKeyDown?: (KeyboardEvent) => void
onKeyUp?: (KeyboardEvent) => void
onSelectionChange?: (Selection) => void
selectedKeys?: 'all' | Iterable<Key>
selectionMode?: SelectionMode
shouldFocusWrap?: boolean
+ shouldUseVirtualFocus?: boolean
} /@react-aria/menu:getItemId+getItemId <T> {
+ state: TreeState<T>
+ itemKey: Key
+ returnVal: undefined
+} /@react-aria/menu:menuData+menuData {
+ UNTYPED
+} @react-stately/autocomplete/@react-stately/autocomplete:useAutocompleteState+useAutocompleteState {
+ props: AutocompleteStateOptions
+ returnVal: undefined
+} /@react-stately/autocomplete:AutocompleteProps+AutocompleteProps {
+ autoFocus?: boolean
+ defaultInputValue?: string
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ inputValue?: string
+ isDisabled?: boolean
+ isReadOnly?: boolean
+ label?: ReactNode
+ onBlur?: (FocusEvent<HTMLInputElement>) => void
+ onFocus?: (FocusEvent<HTMLInputElement>) => void
+ onFocusChange?: (boolean) => void
+ onInputChange?: (string) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholder?: string
+} /@react-stately/autocomplete:AutocompleteStateOptions+AutocompleteStateOptions {
+ autoFocus?: boolean
+ defaultInputValue?: string
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ inputValue?: string
+ isDisabled?: boolean
+ isReadOnly?: boolean
+ label?: ReactNode
+ onBlur?: (FocusEvent<HTMLInputElement>) => void
+ onFocus?: (FocusEvent<HTMLInputElement>) => void
+ onFocusChange?: (boolean) => void
+ onInputChange?: (string) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholder?: string
+} /@react-stately/autocomplete:AutocompleteState+AutocompleteState {
+ focusedNodeId: string | null
+ inputValue: string
+ setFocusedNodeId: (string | null) => void
+ setInputValue: (string) => void
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: