Skip to content

wip: wrap default error message text in V3 DateRangePicker #8623

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion packages/@react-spectrum/datepicker/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}

.react-spectrum-Datepicker-dialog.react-spectrum-Datepicker-dialog {
width: auto;
max-width: fit-content;
Copy link
Member

Choose a reason for hiding this comment

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

instead, you could try

contain: inline-size;

on the :global(.spectrum-Calendar-helpText) No idea why it's global...

}

.react-spectrum-Datepicker-dialogContent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import {action} from '@storybook/addon-actions';
import {ActionButton} from '@react-spectrum/button';
import {CalendarDate, getLocalTimeZone, isWeekend, parseDate, today, toZoned} from '@internationalized/date';
import {CalendarDate, getLocalTimeZone, isWeekend, parseAbsoluteToLocal, parseDate, today, toZoned} from '@internationalized/date';
import {chain} from '@react-aria/utils';
import {Custom454Calendar} from '../../../@internationalized/date/tests/customCalendarImpl';
import {DateRange} from '@react-types/datepicker';
Expand Down Expand Up @@ -114,7 +114,7 @@ AutoFocus.story = {
name: 'autoFocus'
};

export const ValidationStateInvalid: DateRangePickerStory = () => render({validationState: 'invalid', value: {start: new CalendarDate(2020, 2, 3), end: new CalendarDate(2020, 5, 4)}});
export const ValidationStateInvalid: DateRangePickerStory = () => render({validationState: 'invalid', value: {start: new CalendarDate(2020, 2, 3), end: new CalendarDate(2020, 2, 3)}});

ValidationStateInvalid.story = {
name: 'validationState: invalid'
Expand Down Expand Up @@ -303,3 +303,5 @@ function CustomExample(props) {
</Flex>
);
};

export const DefaultErrorMessage: DateRangePickerStory = () => render({defaultValue: {start: parseAbsoluteToLocal('2023-12-01T05:42:14.702226Z'), end: parseAbsoluteToLocal('2025-12-01T05:42:14.702226Z')}, label: 'Report Date', labelPosition: 'side', minValue: parseAbsoluteToLocal('2024-01-01T05:42:14.702226Z'), maxValue: parseAbsoluteToLocal(new Date().toISOString()), hideTimeZone: true, granularity: 'hour'});