mantine icon indicating copy to clipboard operation
mantine copied to clipboard

Button hover won't disappear after touch in certain android phones

Open edenkatabi-aiola opened this issue 2 years ago • 1 comments

What package has an issue

@mantine/core

Describe the bug

Certain Android phones (Tested in Galaxy S10, Galaxy S10e, Galaxy S9) might be probably Samsung Galaxy phones. After pressing the button the hover background won't disappear. It looks like the button is still being pressed even tho the finger is not pressing on the screen.

I found a similar bug here: https://github.com/ionic-team/ionic-framework/issues/18570.

According to what they say there, it's probably something on the chromium related to these specific devices or OS.

Here are some screenshots: BEFORE PRESSING Screenshot_20230913_185729_Chrome

AFTER PRESSING ON SUBTLE VARIANT Screenshot_20230913_185736_Chrome

AFTER PRESSING ON DEFAULT VARIANT Screenshot_20230913_185741_Chrome

AFTER PRESSING ON OUTLINE VARIANT Screenshot_20230913_185759_Chrome

I tried to handle the hover and active selectors of mantine button on my own, but I can't set a color because the hover colors are managed by you guys here: https://github.com/mantinedev/mantine/blob/0455a0f3c47938c0dcae69e5093ce6c28a6bc73b/src/mantine-core/src/Button/Button.styles.ts#L103

What version of @mantine/hooks page do you have in package.json?

6.0.5

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/mantine-6-playground-forked-5sxzdd?file=/src/styles.css:58-101

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

I was thinking about all kinds of solutions.

The first and probably the best one is: add the "background-color" property to the active selector of the button as well. this way, I will be able to override the hover selector with "background-color": unset

The second solution is: If the platform is a mobile device, don't set the hover at all, but set the active (since mobile devices don't have "hover")

edenkatabi-aiola avatar Sep 13 '23 16:09 edenkatabi-aiola

added a pr which should fix the issue: https://github.com/mantinedev/mantine/pull/4761

edenkatabi-aiola avatar Sep 18 '23 11:09 edenkatabi-aiola

The fix is not planned. I do not have all the required devices to validate the fix.

rtivital avatar Feb 26 '24 16:02 rtivital