[@mantine/core] MantineProvider: Fix topmost pixel click issue on active elements#9065
Open
saadpocalypse wants to merge 1 commit into
Open
[@mantine/core] MantineProvider: Fix topmost pixel click issue on active elements#9065saadpocalypse wants to merge 1 commit into
saadpocalypse wants to merge 1 commit into
Conversation
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.
Problem
Clicking on the very topmost pixel of a button, action icon, or other interactive element using the
.mantine-activeclass shows the pointer cursor, but fails to register a click event.This occurs because:
.mantine-activeappliestransform: translateY(rem(1px))to visual elements to create a tactile "pressed" effect.mouseup, the cursor is no longer within the element's boundaries, causing the browser to abort theclickevent.Solution
Refactored the
.mantine-activestyles inpackages/@mantine/core/src/core/MantineProvider/global.css:overflow: visible) during the:activestate.1pxtall transparent::afterpseudo-element positioned attop: rem(-1px)spanning the full width of the element.fieldset:disabledto prevent unwanted interactions.Tests
npm run stylelintand formatted the file withnpm run format:write:files.npm run typecheck) and builds without errors (npm run build).ButtonandActionIconstories to verify that clicking the topmost pixel triggers events correctly and triggers the tactile visual press animation seamlessly.Resolves 9064