Conversation
|
Build successful! 🎉 |
| onPressUp({ | ||
| type: 'pressup', | ||
| pointerType, | ||
| target: originalEvent.target as HTMLElement, |
There was a problem hiding this comment.
spread the original event?
There was a problem hiding this comment.
That would include a lot more properties than we want.
| ...triggerAriaProps, | ||
| id: menuTriggerId, | ||
| onPress, | ||
| onPressStart: onPress, |
There was a problem hiding this comment.
I don't follow this change, can you explain?
|
|
||
| // Aria 1.1 supports multiple values for aria-haspopup other than just menus. | ||
| // https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup | ||
| // However, we only add it for menus for now because screen readers often |
There was a problem hiding this comment.
this comment is now untrue?
There was a problem hiding this comment.
menus and listboxes are close enough where if it is exposed as a menu it's not that big of a deal. we did this in v2.
| return key; | ||
| } | ||
|
|
||
| return ''; |
There was a problem hiding this comment.
will this prevent languages like Chinese?
There was a problem hiding this comment.
nope, see above comment.
| private indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number; | ||
| private layoutInfos: {[key: string]: LayoutInfo}; | ||
| private contentHeight: number; | ||
| collection: Collection<Node<T>>; |
There was a problem hiding this comment.
nope, it must be set by the user
|
|
||
| export interface PressEvent { | ||
| type: 'pressstart' | 'pressend' | 'press', | ||
| type: 'pressstart' | 'pressend' | 'pressup' | 'press', |
There was a problem hiding this comment.
what's the difference between pressup and pressend?
There was a problem hiding this comment.
press up is like mouse up: fired whenever the user releases a pointer over the target. press end is fired whenever the user's pointer leaves the target or is released. press is fired if there is a pointer down event followed by a pointer up event over the target.
|
Build successful! 🎉 |
|
Build successful! 🎉 |
This is an initial version of the
Pickercomponent, along with theuseSelectaria hook anduseSelectStatestately hook. See individual commit messages for some details about related changes.A few notable new features:
<select>works.<select>works.I also had to refactor ListBox into ListBoxBase so that Picker can access it directly. This is to allow the collection state and the layout to be held in the Picker rather than the ListBox. This enables type to select without opening the menu, along with layout info to be cached rather than recomputed every time the ListBox is mounted.
There is still a bunch left to do, including tests and a few more features and bug fixes. Just wanted to get an initial implementation in first and iterate on that rather than a giant PR.