Explore a <DisabledWrapper> component - #38
Draft
Pjaerr wants to merge 1 commit into
Draft
Conversation
Member
Author
|
@amk221 No rush, but I just had a quick play with what a wrapper element could look like to solve this problem. What do you think to this approach? I think the name of the component could be better but I guess it's purpose is very descriptive as |
amk221
force-pushed
the
main
branch
2 times, most recently
from
April 24, 2026 14:09
a286490 to
1a30049
Compare
amk221
force-pushed
the
main
branch
3 times, most recently
from
June 23, 2026 09:09
efd43fc to
8ed7753
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If your tooltipper is a disabled element, the tooltip will not show for keyboard users (as you can't focus a disabled element), or in a test suite with simulated
mouseenterevents for the same reason.This PR explores the addition of a
<DisabledWrapper>component that provides a wrapper acting as a fake element that is focusable. In this scenario the wrapper is the tooltipper, not the disabled element. When the element is not disabled, then the wrapper just acts as an emptydiv.Note that I've had to adjust the focus events to check for
focusinandfocusoutas if a button is not disabled, but is wrapped with<DisabledWrapper>, we don't want to force the user to have to tab twice to get to the button, this change means the wrapper will remain the tooltipper, just not focusable, instead reacting to the bubbling focus event from the button. I'm not too sure on whether this is the right approach, or if there are any knock on effects 馃Note that there are no tests for this functionality yet. This is just exploring it.