-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui][Unstable_TrapFocus] Fix getTabbable
function return type
#42237
Conversation
Netlify deploy previewhttps://deploy-preview-42237--material-ui.netlify.app/ Bundle size report |
Hey @KalmarLorand thanks for taking a stab at this issue. When changing the types you need to run:
to ensure that the propTypes and the docs API are up to date. This will fix the CI failing checks. |
Hey, thanks for the heads-up. I've ran the commands but for some reason nothing no files were changed |
As far as I understand things, this PR should be:
Or maybe alternatively, if clearer:
cc @michaldudak to get a sense of what's the strategy with merging |
The safest option, IMO, would be to move the code of legacy Base UI components used in Material UI to the Material UI sources. |
@michaldudak What risks do you have in mind? In the two options described above, it would be handled with two separate npm packages, "Component" for the new ones, "Component (legacy)" for the old ones: The cons I see with having this code of a Focus Trap split between Material UI and Base UI:
An important constraint I think we should enforce is to have a single owner for the Focus Trap logic, meaning to have it handled similarly to how the maintainer of https://github.com/focus-trap/focus-trap masters this product scope. It shouldn't be an option to have two different owners of two different implementations of the same product scope. Implementing #42237 (comment) doesn't go against this constraint, but doesn't make it clear, so I highlighted it. |
It may turn out we don't need a separate FocusTrap component in Base UI, so the current implementation used by Material UI can be moved to its sources. After we implement Material UI with Base UI, it could be removed altogether, as the logic will be baked in components such as the Dialog.
I'm not sure I'd put the legacy components docs in the same website. A subdomain with docs for @mui/base for existing users (similar to Material UI v4 docs) could work better. Or, (since AFAIK you agreed to put the new docs in a subdomain), we can leave the old docs in place (for @mui/base users) but clearly indicate they relate to the old version and link to the new docs (similarly to how React handles it: https://legacy.reactjs.org/docs/getting-started.html). The current state of things isn't perfect, but we'll be in a much better place when we implement Material UI with @base_ui/react and have a single source of truth for the components logic.
Sorry but I don't understand this bullet point.
I don't want to speak on behalf of @colmtuite, but I don't think we want to just yet. When we have the foundational components ready, we'll advertise Base UI much more aggressively. |
We definitely do not want the legacy components in the same website. We want a fresh, clean site, positioning it as a new product. We don't want anything old weighing it down on day 1. Ideally, the experience shouldn't change at all for legacy base ui users. Same package, same domain name, same docs, same repo etc. All that changes is they get a note in the docs that new Base UI is live, and they should check it out.
Agreed. The pain of duplication is only temporary. When all other libs are built on Base UI, things will be much simpler. But we should live with the pain of duplication for now, otherwise we will compromise Base UI.
We're not focused on or interested in education/marketing right now, because we have nothing to talk about. When we're close to launch, and have our own domain, then we'll begin marketing/educating.
It is critically important that the Base UI team owns all of Base UI. The way to enforce consistency, is to just have other libs be built on top of Base UI. |
getTabbable
function return type
getTabbable
function return typegetTabbable
function return type
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.
I made the changes in Material UI's unstable Focus Trap after its dependency on @mui/base
was removed in #42907. I didn't update the @mui/base
Focus Trap since it's no longer maintained. @KalmarLorand Thanks for the pull request.
Fixes #42231
FocusTrap
component: Change the return type of thegetTabbable
function fromReadonlyArray<string>
toReadonlyArray<HTMLElement>
.