Skip to content
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

[test] Add test for behavior when picker variant changes #26128

Merged
merged 1 commit into from
May 4, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented May 4, 2021

Helps with #26123

Right now I'm probably moving forward with #26123 even though it does regress in certain areas. Since the behavior is already fairly inconsistent (notice how the displayed view changes when switching to mobile i.e. it goes from year to calendar view) I feel safer just resetting entirely instead of only persisting some areas (e.g. open is persisted but not view).

Long term we can probably bring this back by using controlled/uncontrolled patterns. Short term people can restore the previous behavior by controlling open:

function ResponsiveDateTimePicker() {
  const [open, setOpen] = React.useState(false);

	return <DateTimePicker open={open} onClose={() => setOpen(false)} onOpen={() => setOpen(true)} />
}

@eps1lon eps1lon added component: pickers This is the name of the generic UI component, not the React module! test labels May 4, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented May 4, 2021

No bundle size changes

Generated by 🚫 dangerJS against b9c8dd4

@eps1lon eps1lon marked this pull request as ready for review May 4, 2021 14:36
@eps1lon eps1lon merged commit 2e75d2b into mui:next May 4, 2021
@eps1lon eps1lon deleted the test/pickers/responsiveness branch May 4, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants