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

[blog] Update fields behavior on date pickers blog post #36480

Merged
Merged
Show file tree
Hide file tree
Changes from 8 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
21 changes: 15 additions & 6 deletions docs/pages/blog/v6-beta-pickers.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,27 @@ Not only can you type the date as text, but you can also use arrow keys to navig
<source src="/static/blog/v6-beta-pickers/date-field-navigation.mp4" type="video/mp4" />
</video>

Moreover, notice in the following example that as we increase the month, the component automatically watches for valid values throughout each piece of your date input, like you're navigating in a calendar.
For a quick comparison, let's check out how the old and new approaches behave in typical scenarios.

<video style="margin-bottom: 5px; width: 608px;" autoplay muted loop playsinline>
<source src="/static/blog/v6-beta-pickers/smart-field.mp4" type="video/mp4" />
<video style="margin-bottom:24px" autoplay muted loop playsinline >
<source src="/static/blog/v6-beta-pickers/quick-comparison-fields.mp4" type="video/mp4" />
</video>

For a quick comparison, let's check out how the old and new approaches behave in typical scenarios.
Moreover, notice in the following example that as we edit the day, the component automatically navigates only in valid values.

<video style="margin-bottom:24px" autoplay muted loop playsinline>
<source src="/static/blog/v6-beta-pickers/quick-comparison-fields.mp4" type="video/mp4" />
<video style="margin-bottom: 5px; width: 608px;" autoplay muted loop playsinline >
<source src="/static/blog/v6-beta-pickers/smart-field-stable.mp4" type="video/mp4" />
</video>

:::info
**Behavior change alert**

During pre-releases, using <kbd>Arrow Up</kbd> and <kbd>Arrow Down</kbd> to update a date section would essentially update the entire field like you were navigating the calendar.
In the previous example, updating the day value from 28 to 1 would also update the month to March.

On the stable version, released after the original post, this behavior [has been changed](https://github.com/mui/mui-x/issues/7934), and each date section became independent.
joserodolfofreitas marked this conversation as resolved.
Show resolved Hide resolved
:::

Please, try it out for yourself in the live demo below.

<iframe
Expand Down
Binary file not shown.