Skip to content

Commit

Permalink
[docs] Clarify Pickers clearable behavior not working on mobile (mui#…
Browse files Browse the repository at this point in the history
…13786)

Co-authored-by: Lukas <[email protected]>
  • Loading branch information
2 people authored and thomasmoon committed Sep 6, 2024
1 parent 30a257f commit e12d0dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/data/date-pickers/date-picker/ClearableProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { DemoItem } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
import Box from '@mui/material/Box';
import Alert from '@mui/material/Alert';

Expand Down Expand Up @@ -31,8 +31,8 @@ export default function ClearableProp() {
position: 'relative',
}}
>
<DemoItem label="DatePicker">
<DatePicker
<DemoItem label="DesktopDatePicker">
<DesktopDatePicker
sx={{ width: 260 }}
slotProps={{
field: { clearable: true, onClear: () => setCleared(true) },
Expand Down
6 changes: 3 additions & 3 deletions docs/data/date-pickers/date-picker/ClearableProp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { DemoItem } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
import Box from '@mui/material/Box';
import Alert from '@mui/material/Alert';

Expand Down Expand Up @@ -31,8 +31,8 @@ export default function ClearableProp() {
position: 'relative',
}}
>
<DemoItem label="DatePicker">
<DatePicker
<DemoItem label="DesktopDatePicker">
<DesktopDatePicker
sx={{ width: 260 }}
slotProps={{
field: { clearable: true, onClear: () => setCleared(true) },
Expand Down
10 changes: 10 additions & 0 deletions docs/data/date-pickers/date-picker/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ You can enable the clearable behavior:

{{"demo": "ClearableProp.js"}}

:::info
See [Field components—Clearable behavior](/x/react-date-pickers/fields/#clearable-behavior) for more details.
:::

:::warning
The clearable prop is not supported yet by the mobile Picker variants.

See discussion [in this GitHub issue](https://github.com/mui/mui-x/issues/10842#issuecomment-1951887408) for more information.
:::

## Localization

See the [Date format and localization](/x/react-date-pickers/adapters-locale/) and [Translated components](/x/react-date-pickers/localization/) documentation pages for more details.
Expand Down

0 comments on commit e12d0dc

Please sign in to comment.