-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: Update docs for new --page-height var and ComboBox actions #8955
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
Conversation
By default, `Modal` includes a builtin `ModalOverlay`, which renders a backdrop over the page when a modal is open. This can be targeted using the `.react-aria-ModalOverlay` CSS selector. To customize the `ModalOverlay` with a different class name or other attributes, render a `ModalOverlay` and place a `Modal` inside. | ||
|
||
The `--visual-viewport-height` CSS custom property will be set on the `ModalOverlay`, which you can use to set the height to account for the virtual keyboard on mobile. | ||
The `--visual-viewport-height` and `--page-height` CSS custom property will be set on the `ModalOverlay`, which you can use to set the height to account for the virtual keyboard on mobile. |
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.
How much do we want to explain here? I debated whether or not to mention iOS 26 specifically (and thus explain the difference between the two properties here).
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.
I think it would be useful to at least the explain the differences since it might not be immediately obvious
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.
kk clarified the wording in the sentence and added a comment to the css example, hopefully that keeps it concise enough but distinguishes the two properties
Build successful! 🎉 |
Build successful! 🎉 |
} | ||
``` | ||
|
||
## Row actions |
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.
## Row actions | |
## Item actions |
## Row actions | ||
|
||
By default, interacting with an item in a ComboBox selects it and updates the input value. Alternatively, items can also trigger a custom action instead via providing a `onAction` prop to the ListBoxItem. | ||
As shown in the example below, a "Create" action is added for the current input value. Note that interacting with said item does not update selection or the input value. |
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.
Can we copy the text I wrote for the new docs? This is a bit more verbose.
Build successful! 🎉 |
|
||
## Item actions | ||
|
||
Use the `onAction` prop on a `<ListBoxItem>` to perform a custom action when the item is selected. This example adds a "Create" action for the current input value. |
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.
when the item is selected
isn't this a little misnomer? if it has an action, it doesn't get selected?
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.
"activated" maybe? "triggered"?
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.
or just "pressed"?
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.
pressed is fine. you can update the new docs too if you want. fyi the same thing is in S2 and RAC docs.
Build successful! 🎉 |
export {Heading} from './Heading'; | ||
export {Input, InputContext} from './Input'; | ||
export {Section, CollectionRendererContext, DefaultCollectionRenderer} from './Collection'; | ||
export {Collection, createLeafComponent as UNSTABLE_createLeafComponent, createBranchComponent as UNSTABLE_createBranchComponent, CollectionBuilder as UNSTABLE_CollectionBuilder} from '@react-aria/collections'; |
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.
glad we don't use the UNSTABLE anywhere in our own code, but this could be problematic for libraries that are built on top of us
in order for this to stay non-breaking for semver, we need to keep the UNSTABLE as well :(
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.
if you put the unstables on a separate line, maybe we can put a @deprecated
comment before just them
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.
urgh, that sucks. Doesn't look like the deprecated comment actually comes through when importing so I've omitted it for now
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 one is not a cross-package dependency so it's ok to remove. If other teams are using it then they should be pinning their version of RAC. The original problem was that we were not pinning between our own dependencies.
Build successful! 🎉 |
## API Changes
react-aria-components/react-aria-components:UNSTABLE_createLeafComponent-UNSTABLE_createLeafComponent <E extends Element, P extends {}> {
- CollectionNodeClass: {}<any> | string
- render: (P, ForwardedRef<E>, any) => ReactElement | null
- returnVal: undefined
-} /react-aria-components:UNSTABLE_createBranchComponent-UNSTABLE_createBranchComponent <E extends Element, P extends {
- children?: any
-}, T extends {}> {
- CollectionNodeClass: {}<any> | string
- render: (P, ForwardedRef<E>, Node<T>) => ReactElement | null
- useChildren: (P) => ReactNode
- returnVal: undefined
-} /react-aria-components:UNSTABLE_CollectionBuilder-UNSTABLE_CollectionBuilder <C extends BaseCollection<{}>> {
- children: (BaseCollection<{}>) => ReactNode
- content: ReactNode
- createCollection?: () => BaseCollection<{}>
-} /react-aria-components:createLeafComponent+createLeafComponent <E extends Element, P extends {}> {
+ CollectionNodeClass: {}<any> | string
+ render: (P, ForwardedRef<E>, any) => ReactElement | null
+ returnVal: undefined
+} /react-aria-components:createBranchComponent+createBranchComponent <E extends Element, P extends {
+ children?: any
+}, T extends {}> {
+ CollectionNodeClass: {}<any> | string
+ render: (P, ForwardedRef<E>, Node<T>) => ReactElement | null
+ useChildren: (P) => ReactNode
+ returnVal: undefined
+} /react-aria-components:CollectionBuilder+CollectionBuilder <C extends BaseCollection<{}>> {
+ children: (BaseCollection<{}>) => ReactNode
+ content: ReactNode
+ createCollection?: () => BaseCollection<{}>
+} |
ugh react 17 test randomly failed |
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project:
RSP