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

[pickers] Change mobile dialog close behavior #7721

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"default": "typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)"
},
"renderLoading": { "type": { "name": "func" }, "default": "() => \"...\"" },
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/desktop-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/desktop-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"default": "typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)"
},
"renderLoading": { "type": { "name": "func" }, "default": "() => \"...\"" },
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/desktop-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/desktop-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"orientation": {
"type": { "name": "enum", "description": "'landscape'<br>&#124;&nbsp;'portrait'" }
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/mobile-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/mobile-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"default": "typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)"
},
"renderLoading": { "type": { "name": "func" }, "default": "() => \"...\"" },
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/mobile-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"type": { "name": "func" },
"default": "() => <span data-mui-test=\"loading-progress\">...</span>"
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/mobile-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"orientation": {
"type": { "name": "enum", "description": "'landscape'<br>&#124;&nbsp;'portrait'" }
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/x/api/date-pickers/time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"orientation": {
"type": { "name": "enum", "description": "'landscape'<br>&#124;&nbsp;'portrait'" }
},
"resetValueOnDismiss": {
"type": { "name": "bool" },
"default": "`true` for mobile, `false` for desktop."
},
"selectedSections": {
"type": {
"name": "union",
Expand Down
1 change: 1 addition & 0 deletions docs/translations/api-docs/date-pickers/date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"orientation": "Force rendering in particular orientation.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date.<br><br><strong>Signature:</strong><br><code>function(day: TDate) =&gt; boolean</code><br><em>day:</em> The date to test.<br> <em>returns</em> (boolean): If <code>true</code> the date will be disabled.",
"shouldDisableMonth": "Disable specific month.<br><br><strong>Signature:</strong><br><code>function(month: TDate) =&gt; boolean</code><br><em>month:</em> The month to test.<br> <em>returns</em> (boolean): If <code>true</code>, the month will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"open": "Control the popup or dialog open state.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date. @DateIOType<br><br><strong>Signature:</strong><br><code>function(day: TDate, position: string) =&gt; boolean</code><br><em>day:</em> The date to test.<br><em>position:</em> The date to test, &#39;start&#39; or &#39;end&#39;.<br> <em>returns</em> (boolean): Returns <code>true</code> if the date should be disabled.",
"showDaysOutsideCurrentMonth": "If <code>true</code>, days outside the current month are rendered:<br>- if <code>fixedWeekNumber</code> is defined, renders days to have the weeks requested.<br>- if <code>fixedWeekNumber</code> is not defined, renders day to fill the first and last week of the current month.<br>- ignored if <code>calendars</code> equals more than <code>1</code> on range pickers.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"orientation": "Force rendering in particular orientation.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableClock": "Disable specific clock time.<br><br><strong>Signature:</strong><br><code>function(clockValue: number, view: TimeView) =&gt; boolean</code><br><em>clockValue:</em> The value to check.<br><em>view:</em> The clock type of the timeValue.<br> <em>returns</em> (boolean): If <code>true</code> the time will be disabled.",
"shouldDisableDate": "Disable specific date.<br><br><strong>Signature:</strong><br><code>function(day: TDate) =&gt; boolean</code><br><em>day:</em> The date to test.<br> <em>returns</em> (boolean): If <code>true</code> the date will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"orientation": "Force rendering in particular orientation.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date.<br><br><strong>Signature:</strong><br><code>function(day: TDate) =&gt; boolean</code><br><em>day:</em> The date to test.<br> <em>returns</em> (boolean): If <code>true</code> the date will be disabled.",
"shouldDisableMonth": "Disable specific month.<br><br><strong>Signature:</strong><br><code>function(month: TDate) =&gt; boolean</code><br><em>month:</em> The month to test.<br> <em>returns</em> (boolean): If <code>true</code>, the month will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"open": "Control the popup or dialog open state.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date. @DateIOType<br><br><strong>Signature:</strong><br><code>function(day: TDate, position: string) =&gt; boolean</code><br><em>day:</em> The date to test.<br><em>position:</em> The date to test, &#39;start&#39; or &#39;end&#39;.<br> <em>returns</em> (boolean): Returns <code>true</code> if the date should be disabled.",
"showDaysOutsideCurrentMonth": "If <code>true</code>, days outside the current month are rendered:<br>- if <code>fixedWeekNumber</code> is defined, renders days to have the weeks requested.<br>- if <code>fixedWeekNumber</code> is not defined, renders day to fill the first and last week of the current month.<br>- ignored if <code>calendars</code> equals more than <code>1</code> on range pickers.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"orientation": "Force rendering in particular orientation.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableClock": "Disable specific clock time.<br><br><strong>Signature:</strong><br><code>function(clockValue: number, view: TimeView) =&gt; boolean</code><br><em>clockValue:</em> The value to check.<br><em>view:</em> The clock type of the timeValue.<br> <em>returns</em> (boolean): If <code>true</code> the time will be disabled.",
"shouldDisableDate": "Disable specific date.<br><br><strong>Signature:</strong><br><code>function(day: TDate) =&gt; boolean</code><br><em>day:</em> The date to test.<br> <em>returns</em> (boolean): If <code>true</code> the date will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"open": "Control the popup or dialog open state.",
"openTo": "The default visible view. Used when the component view is not controlled. Must be a valid option from <code>views</code> list.",
"orientation": "Force rendering in particular orientation.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableClock": "Disable specific clock time.<br><br><strong>Signature:</strong><br><code>function(clockValue: number, view: TimeView) =&gt; boolean</code><br><em>clockValue:</em> The value to check.<br><em>view:</em> The clock type of the timeValue.<br> <em>returns</em> (boolean): If <code>true</code> the time will be disabled.",
"shouldDisableTime": "Disable specific time.<br><br><strong>Signature:</strong><br><code>function(value: TDate, view: TimeView) =&gt; boolean</code><br><em>value:</em> The value to check.<br><em>view:</em> The clock type of the timeValue.<br> <em>returns</em> (boolean): If <code>true</code> the time will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"orientation": "Force rendering in particular orientation.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date.<br><br><strong>Signature:</strong><br><code>function(day: TDate) =&gt; boolean</code><br><em>day:</em> The date to test.<br> <em>returns</em> (boolean): If <code>true</code> the date will be disabled.",
"shouldDisableMonth": "Disable specific month.<br><br><strong>Signature:</strong><br><code>function(month: TDate) =&gt; boolean</code><br><em>month:</em> The month to test.<br> <em>returns</em> (boolean): If <code>true</code>, the month will be disabled.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"open": "Control the popup or dialog open state.",
"reduceAnimations": "Disable heavy animations.",
"renderLoading": "Component displaying when passed <code>loading</code> true.<br><br><strong>Signature:</strong><br><code>function() =&gt; React.ReactNode</code><br><br> <em>returns</em> (React.ReactNode): The node to render when loading.",
"resetValueOnDismiss": "If <code>true</code>, on dismiss will reset the value to the value when the picker was opened.<br>Might make most sense when in need of resetting the value on modal dismiss.",
"selectedSections": "The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a <code>startIndex</code> and <code>endIndex</code> properties are provided, the sections between those two indexes will be selected. 3. If a string of type <code>MuiDateSectionName</code> is provided, the first section with that name will be selected. 4. If <code>null</code> is provided, no section will be selected If not provided, the selected sections will be handled internally.",
"shouldDisableDate": "Disable specific date. @DateIOType<br><br><strong>Signature:</strong><br><code>function(day: TDate, position: string) =&gt; boolean</code><br><em>day:</em> The date to test.<br><em>position:</em> The date to test, &#39;start&#39; or &#39;end&#39;.<br> <em>returns</em> (boolean): Returns <code>true</code> if the date should be disabled.",
"showDaysOutsideCurrentMonth": "If <code>true</code>, days outside the current month are rendered:<br>- if <code>fixedWeekNumber</code> is defined, renders days to have the weeks requested.<br>- if <code>fixedWeekNumber</code> is not defined, renders day to fill the first and last week of the current month.<br>- ignored if <code>calendars</code> equals more than <code>1</code> on range pickers.",
Expand Down
Loading