Skip to content

Commit

Permalink
[pickers] Fix view management when openTo or views is modified (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored May 16, 2023
1 parent 1a25ce7 commit ebf2715
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/x-date-pickers/src/internals/hooks/useViews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export function useViews<TValue, TView extends DateOrTimeViewWithMeridiem>({
previousViews.current.some((previousView) => !views.includes(previousView)))
) {
setView(views.includes(openTo!) ? openTo! : views[0]);
previousViews.current = views;
previousOpenTo.current = openTo;
}
}, [openTo, setView, view, views]);

Expand Down

0 comments on commit ebf2715

Please sign in to comment.