-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[docs] Fix a few scroll issues on mobile #7900
[docs] Fix a few scroll issues on mobile #7900
Conversation
These are the results for the performance tests:
|
@@ -78,6 +78,7 @@ function LocalisationTable(props) { | |||
<MarkdownElement | |||
sx={{ | |||
width: '100%', | |||
px: [2, 0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -65,6 +65,7 @@ function CustomLayout(props: PickersLayoutProps<Dayjs | null, Dayjs, DateView>) | |||
<PickersLayoutRoot | |||
ownerState={props} | |||
sx={{ | |||
overflow: 'auto', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers-pro/src/internal/hooks/useStaticRangePicker/useStaticRangePicker.tsx
Outdated
Show resolved
Hide resolved
@@ -105,7 +105,9 @@ export function DemoContainer(props: DemoGridProps) { | |||
|
|||
let direction: StackProps['direction']; | |||
let spacing: StackProps['spacing']; | |||
let sx: StackProps['sx']; | |||
let sx: StackProps['sx'] = { | |||
overflow: 'auto', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice improvements! 💯
Left a few improvement comments as well as a suggestion to limit the PR impact to only docs scope. 🤔
docs/data/date-pickers/date-range-calendar/CustomDateRangePickerDay.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers-pro/src/internal/hooks/useStaticRangePicker/useStaticRangePicker.tsx
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice result! 👍
I do agree that those simple demos with only one element can benefit from increased simplicity by removing the redundant DemoContainer
wrapper.
If we ever add certain styling logic, which would be needed for them—it's not a rocket science to re-introduce it. 👌
If we are removing it from demos having one example, could we also remove DemoContainer
from https://deploy-preview-7900--material-ui-x.netlify.app/x/react-date-pickers/date-picker/#basic-usage ?
What's your take on it @flaviendelangle? After all, it's "your baby". 🙈
It also handles the responsive rules when several items can be placed next to one another. |
I've looked through the changes and the only regression is with the |
d305bd4
to
e46eb36
Compare
e46eb36
to
ca9a7b2
Compare
Actually, we didn't add |
5f78e0e
to
102d953
Compare
68e8f0e
to
5e8a5a6
Compare
Nice 👌 |
ad4a7e8
to
ded61af
Compare
ded61af
to
801b397
Compare
Ok, I think that I'm good now. I have pushed forward with the
But I get why, it's hard to get it right! You have to constantly check each change on many different pages. I could improve a bit the situation, but I couldn't make it work everywhere. I felt that the best way to get something reliably great is to take the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! 👍
Left a few comments and a question to Flavien.
docs/data/date-pickers/base-concepts/ComponentExplorerNoSnap.tsx
Outdated
Show resolved
Hide resolved
alignItems="stretch" | ||
spacing={spacing} | ||
sx={sx} | ||
className={textFieldClasses.root} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And example of issue is https://next.mui.com/x/react-date-pickers/time-range-field/#uncontrolled-vs-controlled that doesn't receive the right min width because there is a DemoItem
wrapper, but I have reverted. We don't have to fix this in this PR.
@@ -9,6 +9,7 @@ export default function TimePickerViews() { | |||
<LocalizationProvider dateAdapter={AdapterDayjs}> | |||
<DemoContainer | |||
components={['MobileTimePicker', 'MobileTimePicker', 'MobileTimePicker']} | |||
sx={{ minWidth: 210 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to this fix mui/material-ui#36246, the label label={'"hours", "minutes" and "seconds"'}
overflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
Thank you for all the effort! 🙏
I've looked through Argos changes and didn't find any regressions there, so I approved the changes.
There is still the issue of static landscape pickers having overflow: hidden
that prevents the content from being interacted with on narrow viewports, but that is probably better resolved by a separate PR looking into feasibility of changing the overflow:hidden
to possibly overflow: auto
. 👍
Great, it turned out to be more work than I thought, but it was a great forcing function for me to read all the pages of the docs. |
Fix for SEO https://search.google.com/search-console/mobile-usability?resource_id=sc-domain:mui.com&utm_source=wnc_10030322&utm_medium=gamma&utm_campaign=wnc_10030322&utm_content=msg_100058679&hl=en
Fix part of #5652