Repository navigation
fix(labs): split button clicks on the menu icon and touch targets - #6112
Open
MahmoodKhalil57 wants to merge 1 commit into
Open
MahmoodKhalil57 wants to merge 1 commit into
MahmoodKhalil57 wants to merge 1 commit into
Conversation
The leading slot's 48dp touch target is an absolutely positioned ::before. The slot has display: contents, so the touch target sized itself against the viewport. It covered the page around the split button and took clicks meant for nearby content. The menu icon is the trailing slot's ::after, and it painted over the slotted button, so clicking the chevron did nothing. The container now positions the touch targets, and the icon lets pointer events through. A click on a slot's touch target outside the slotted button now activates that button.
This branch has not been deployed
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.
This fixes two bugs in
md-gb-split-button.::before. The slot hasdisplay: contents, so the touch target sizes itself against the viewport. It covers the page around the split button and takes clicks meant for nearby content.::after, and it paints over the slotted button. Clicking the chevron does nothing.The container now positions the touch targets, and the icon lets pointer events through to the button. A click on a slot's touch target outside the slotted button now activates that button.
The change is in
labs/gb/components/splitbutton/split-button-element.ts. Upstream has no split button tests yet. I have behavior tests for both bugs on my branch and can add them in a test file if you want one.