Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion packages/dev/s2-docs/pages/react-aria/Modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ const CustomTrigger = React.forwardRef((props, ref) => (
showDescription
cssVariables={{
'--visual-viewport-height': 'The height of the [Visual Viewport](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API), i.e. space above the software keyboard.',
'--page-height': 'The height of the `<body>` element. Useful for sizing the modal backdrop.'
'--visual-viewport-width': 'The width of the [Visual Viewport](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API).',
'--page-height': 'The height of the `<body>` element. Useful for sizing and positioning the modal backdrop.',
'--page-width': 'The width of the `<body>` element. Useful for sizing and positioning the modal backdrop.'
}} />

### Dialog
Expand Down
21 changes: 21 additions & 0 deletions packages/dev/s2-docs/pages/react-aria/RangeCalendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,27 @@ import {ChevronLeft, ChevronRight} from 'lucide-react';
</RangeCalendar>
```

## Interact outside behavior
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be ok just having this in the prop table, not sure what other people think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. Add it as a prop control to the top example as well.


Use the `interactOutsideBehavior` prop to control what happens when a range selection is in progress and the user interacts outside the calendar.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the `interactOutsideBehavior` prop to control what happens when a range selection is in progress and the user interacts outside the calendar.
Use the `interactOutsideBehavior` prop to control what happens when a range selection is in progress and the user interacts outside the available dates.


```tsx render docs={docs.exports.RangeCalendar} links={docs.links} props={['interactOutsideBehavior']} initialProps={{interactOutsideBehavior: 'select'}}
"use client";
import {RangeCalendar} from 'vanilla-starter/RangeCalendar';
import {parseDate} from '@internationalized/date';

<RangeCalendar
aria-label="Trip dates"
defaultValue={{
start: parseDate('2025-02-03'),
end: parseDate('2025-02-12')
}}
///- begin highlight -///
/* PROPS */
///- end highlight -///
/>
```

## API

<Anatomy
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/pages/react-aria/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const description = 'Displays a collapsible list of options and allows a
<PageDescription>{docs.exports.Select.description}</PageDescription>

<ExampleSwitcher>
```tsx render docs={vanillaDocs.exports.Select} links={docs.links} props={['label', 'placeholder', 'selectionMode', 'isDisabled']} initialProps={{label: 'Favorite Animal'}} type="vanilla" files={["starters/docs/src/Select.tsx", "starters/docs/src/Select.css"]}
```tsx render docs={vanillaDocs.exports.Select} links={docs.links} props={['label', 'placeholder', 'selectionMode', 'isDisabled', 'shouldCloseOnSelect']} initialProps={{label: 'Favorite Animal', shouldCloseOnSelect: true}} type="vanilla" files={["starters/docs/src/Select.tsx", "starters/docs/src/Select.css"]}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in weird behavior because then multi-select will also close on select which is not the default. I say just omit this. It's a rare use case.

"use client";
import {Select, SelectItem} from 'vanilla-starter/Select';

Expand Down
23 changes: 22 additions & 1 deletion packages/dev/s2-docs/pages/s2/RangeCalendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Example() {
end: parseDate('2025-02-12')
});
let formatter = useDateFormatter({ dateStyle: 'long' });

return (
<>
<RangeCalendar
Expand Down Expand Up @@ -243,6 +243,27 @@ function Example() {
}
```

## Interact outside behavior

Use the `interactOutsideBehavior` prop to control what happens when a range selection is in progress and the user interacts outside the calendar.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


```tsx render docs={docs.exports.RangeCalendar} links={docs.links} props={['interactOutsideBehavior']} initialProps={{interactOutsideBehavior: 'select'}} type="s2"
"use client";
import {RangeCalendar} from '@react-spectrum/s2';
import {parseDate} from '@internationalized/date';

<RangeCalendar
aria-label="Trip dates"
defaultValue={{
start: parseDate('2025-02-03'),
end: parseDate('2025-02-12')
}}
///- begin highlight -///
/* PROPS */
///- end highlight -///
/>
```

## API

<PropTable component={docs.exports.RangeCalendar} links={docs.links} />
Loading