Skip to content

Commit 376a1eb

Browse files
authored
Fix Calendar/DateRangePicker overflow in docs/stories (#2812)
1 parent b62d8fb commit 376a1eb

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/@react-spectrum/calendar/stories/Calendar.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import React, {useState} from 'react';
2020
import {storiesOf} from '@storybook/react';
2121
import {TimeField} from '@react-spectrum/datepicker';
2222
import {useLocale} from '@react-aria/i18n';
23+
import {View} from '@react-spectrum/view';
2324

2425
storiesOf('Date and Time/Calendar', module)
2526
.add(
@@ -148,7 +149,9 @@ function Example(props) {
148149
</Picker>
149150
</Flex>
150151
<Provider locale={(locale || defaultLocale) + (calendar && calendar !== preferredCalendars[0].key ? '-u-ca-' + calendar : '')}>
151-
<Calendar {...props} />
152+
<View maxWidth="100vw" overflow="auto">
153+
<Calendar {...props} />
154+
</View>
152155
</Provider>
153156
</Flex>
154157
);

packages/@react-spectrum/calendar/stories/RangeCalendar.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import React, {useState} from 'react';
2020
import {storiesOf} from '@storybook/react';
2121
import styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';
2222
import {TimeField} from '@react-spectrum/datepicker';
23+
import {View} from '@react-spectrum/view';
2324

2425
storiesOf('Date and Time/RangeCalendar', module)
2526
.add(
@@ -131,7 +132,11 @@ storiesOf('Date and Time/RangeCalendar/cell', module)
131132
);
132133

133134
function render(props = {}) {
134-
return <RangeCalendar onChange={action('change')} {...props} />;
135+
return (
136+
<View maxWidth="100vw" overflow="auto">
137+
<RangeCalendar onChange={action('change')} {...props} />
138+
</View>
139+
);
135140
}
136141

137142
function RangeCalendarWithTime() {

packages/@react-spectrum/datepicker/src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper {
1414
width: auto;
1515
min-width: var(--spectrum-global-dimension-size-2000);
16+
max-width: 100%;
1617
}
1718

1819
.react-spectrum-Datepicker-startField {

0 commit comments

Comments
 (0)