-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: support selectionMode="replace" in grid collection test utils #8028
base: main
Are you sure you want to change the base?
Conversation
now we shouldnt need to call runAllTimers after selectOption
… into highlight_selection_test_util_support
if a checkbox wasnt present we werent using the keyboard navigate logic flow
…gation simulation to util
## API Changes
@react-aria/test-utils/@react-aria/test-utils:triggerLongPress triggerLongPress {
opts: {
element: HTMLElement
- advanceTimer: (number) => void | Promise<unknown>
+ advanceTimer: (number) => unknown | Promise<unknown>
pointerOpts?: Record<string, any>
}
returnVal: undefined
} /@react-aria/test-utils:UserOpts UserOpts {
- advanceTimer?: (number) => void | Promise<unknown>
+ advanceTimer?: (number) => unknown | Promise<unknown>
interactionType?: 'mouse' | 'touch' | 'keyboard' = mouse
} @react-spectrum/test-utils/@react-spectrum/test-utils:triggerLongPress triggerLongPress {
opts: {
element: HTMLElement
- advanceTimer: (number) => void | Promise<unknown>
+ advanceTimer: (number) => unknown | Promise<unknown>
pointerOpts?: Record<string, any>
}
returnVal: undefined
} /@react-spectrum/test-utils:UserOpts UserOpts {
- advanceTimer?: (number) => void | Promise<unknown>
+ advanceTimer?: (number) => unknown | Promise<unknown>
interactionType?: 'mouse' | 'touch' | 'keyboard' = mouse
} |
// TODO: perhaps this should just be shouldUseModifierKeys? | ||
selectionBehavior = 'toggle' |
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.
This API naming feels unclear TBH, people may be confused as to when they would apply it. When set to selectionBehavior="replace"
this causes the alt/meta key to be used when keyboard navigating/pressing to select a row so that it doesn't cause your previous selection to be replaced on focus/click. I wasn't certain if something like shouldUseModifierKeys
was clear either since a user may not know what the "modifier keys" even do
Closes #7884
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: