Skip to content

[docs][Autocomplete] Fix virtualization demo#44382

Merged
DiegoAndai merged 4 commits intomui:masterfrom
DiegoAndai:autocomplete-slots-docs
Nov 15, 2024
Merged

[docs][Autocomplete] Fix virtualization demo#44382
DiegoAndai merged 4 commits intomui:masterfrom
DiegoAndai:autocomplete-slots-docs

Conversation

@DiegoAndai
Copy link
Copy Markdown
Member

@DiegoAndai DiegoAndai commented Nov 11, 2024

Fix the virtualization demo options style, which should've used slotProps.listbox.component instead of slots.listbox, as we wish to keep the original listbox style.

Closes #44329
Closes #44189

Preview: https://deploy-preview-44382--material-ui.netlify.app/material-ui/react-autocomplete/#virtualization

@DiegoAndai DiegoAndai added docs Improvements or additions to the documentation. package: material-ui scope: autocomplete Changes related to the autocomplete. This includes ComboBox. labels Nov 11, 2024
@DiegoAndai DiegoAndai self-assigned this Nov 11, 2024
@mui-bot
Copy link
Copy Markdown

mui-bot commented Nov 11, 2024

Netlify deploy preview

https://deploy-preview-44382--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 872eecb

@DiegoAndai DiegoAndai changed the title [docs][material-ui][Autocompelte] Fix virtualization demo [docs][material-ui][Autocomplete] Fix virtualization demo Nov 11, 2024
return result;
}

const StyledPopper = styled(Popper)({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this change relevant to the PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I brought it back in d4ac56d. The idea was to simplify the demo and keep the base listbox styles, but I reconsidered and it's better to keep the PR smaller and only with the required changes 👍🏼

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't have worked, it needs padding: 0 and margin: 0, it would break without:

SCR-20241111-tpxu

@DiegoAndai
Copy link
Copy Markdown
Member Author

The demo's preview is being removed because it now surpasses the line limit: it has 19 lines, and the line limit for previews is 16. Should we accept this, or do we want to skip the limit for this demo? @siriwatknp @mnajdova

@DiegoAndai
Copy link
Copy Markdown
Member Author

I think it's better to comply with the max lines rule for consistency, so the preview will now be hidden.

Copy link
Copy Markdown
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I noticed that for some reason the CodeSandbox export throws an error:

×
TypeError
(0 , $csb__eMediaQuery.unstable_createUseMediaQuery) is not a function

Stackblitz is working as expected. We could investigate it separately.

@DiegoAndai
Copy link
Copy Markdown
Member Author

@mnajdova seems like Codesandbox is using a stale version of @mui/system, specifying the latest 6.1.7 (in which unstable_createUseMediaQuery was introduced) fixes it: https://codesandbox.io/p/sandbox/vigorous-tesla-hgt7xs

@DiegoAndai DiegoAndai merged commit 4e26c0b into mui:master Nov 15, 2024
@DiegoAndai DiegoAndai deleted the autocomplete-slots-docs branch November 15, 2024 15:32
Comment thread docs/data/material/components/autocomplete/Virtualize.tsx
return result;
}

const StyledPopper = styled(Popper)({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't have worked, it needs padding: 0 and margin: 0, it would break without:

SCR-20241111-tpxu

});

const OPTIONS = Array.from(new Array(10000))
.map(() => random(10 + Math.ceil(Math.random() * 20)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work, unstable screenshots https://app.argos-ci.com/mui/material-ui/builds/33543/119540069.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, opened a PR to fix it: #44425

@oliviertassinari oliviertassinari changed the title [docs][material-ui][Autocomplete] Fix virtualization demo [docs][Autocomplete] Fix virtualization demo Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. scope: autocomplete Changes related to the autocomplete. This includes ComboBox.

Projects

None yet

4 participants