Closed jennydaman closed 6 years ago
You should be able to fix this globally:
let lock = 0;
addEventListener('mouseup', e => {
if (lock) return;
let { target } = e;
do {
if (target.classList && target.classList.contains('mdc-ripple-upgraded--foreground-activation')) {
lock++;
fireEvent(target, 'pointerup');
fireEvent(target, 'mouseup');
fireEvent(target, 'touchend');
lock--;
return;
}
} while ((target=target.parentNode));
}, { passive: true });
Looks scary, but thanks!
this an other ripples are long pending bugs on mdc-web.
I wonder if we should have a fix available, under experimental
folder or something.
Before submitting this issue, i searched intensively for a solution upstream. Apparently, the persistent ripple is an intentional feature, it is how they handle :focus state for users using the tab key and no mouse. I'll find and link the original PR when i get home.
My opinion is that this effect is distasteful. The issue does not exist with MDL, but MDC will supersede MDL so I'm trying to stay on the bleeding edge...
https://github.com/material-components/material-components-web/issues/809#issuecomment-353147714
https://github.com/material-components/material-components-web/issues/1951#issuecomment-358785479
And just a minute ago: https://github.com/material-components/material-components-web/issues/2337#issuecomment-370544239
I'll summarize my findings for future reference.
:focus
is ugly, no tooltip:focus
correctly, looks nice, but the library is outdated eg. tabs don't have animations
Is there a safe and proper way of making the focus circle disappear after tap/click?