material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[base] Removes invisible tabbable elements from `TrapFocus` component

Open EthanStandel opened this issue 1 year ago • 8 comments

Problem description

Described in issue #33380

Solution

Setting tabIndex={open ? 0 : -1} on sentinelStart and sentinelEnd elements so that they're only tabbable when the TrapFocus open prop is true. Thus removing the awkward experience where there are invisible tabbable elements.

EthanStandel avatar Jul 17 '22 06:07 EthanStandel

Details of bundle changes

Generated by :no_entry_sign: dangerJS against bf6dd7d8a75c36394bef7c3ccde77a95a9d74644

mui-bot avatar Jul 17 '22 06:07 mui-bot

cc @michaldudak would be great to have a second opinion on the changes. @samuelsycamore for reviewing the copywriting.

mnajdova avatar Jul 27 '22 14:07 mnajdova

I haven't thought of such a use case before, but these changes look OK to me. As a follow-up, I think we'd have to rename the open prop. enabled would make more sense, especially for such cases.

michaldudak avatar Jul 27 '22 14:07 michaldudak

When I tried to resync the master branch of my fork the PR autoclosed! Reopening!

EthanStandel avatar Jul 28 '22 00:07 EthanStandel

@michaldudak I really like the idea of the prop being enabled, but I also know that change could be wide reaching. You're not recommending that change for this PR, are you?

EthanStandel avatar Jul 28 '22 01:07 EthanStandel

No, not at all, this should be a separate PR that we can handle on our own.

michaldudak avatar Jul 28 '22 11:07 michaldudak

Same deal as before. Next time I won't open a PR off a fork from master. I'd change to another branch now but it seems like I'd have to open a new PR.

EthanStandel avatar Aug 03 '22 03:08 EthanStandel

Requesting a re-review from @samuelsycamore & @mnajdova ! 😄

Is that how I should do that? I legitimately don't know.

EthanStandel avatar Aug 05 '22 03:08 EthanStandel