Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

MDCRipple: Context menu causes ripple to remain activated #3524

Closed
williamernest opened this issue Sep 5, 2018 · 1 comment · Fixed by #3759
Closed

MDCRipple: Context menu causes ripple to remain activated #3524

williamernest opened this issue Sep 5, 2018 · 1 comment · Fixed by #3759
Assignees
Milestone

Comments

@williamernest
Copy link
Contributor

Steps to reproduce:

  1. Long press on a button when in chrome touch mode.
  2. Click Esc when the menu appears.
  3. Click Tab to focus the next element.
    Notice that the button stays dark while focus has moved to other elements. The button element retains the :hover psuedo-class (See Note) but it also has the FG_ACTIVATION class that causes it be a darker color and more noticeable.

I was able to get the button to return to almost normal (still has the :hover state), by removing the activation class and resetting the activate state in the handleBlur function.

  handleBlur() {
    requestAnimationFrame(() => {
      this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
      this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
      this.resetActivationState_();
    });
  }
@kfranqueiro
Copy link
Contributor

This is also reproducible simply by right-clicking on desktop (which opens the context menu just like long-press on mobile does). I think the stuck hover state on mobile might be unavoidable, but we ought to be able to resolve the stuck activation related to context menus either via the above change, or possibly via the contextmenu event (but it might be odd for activation to clear while the menu is still open).

I had thought we might have tracked this already but I can't find an existing issue about this, so I'll track this one.

@kfranqueiro kfranqueiro changed the title MDCRipple: Touch long press sometimes causes ripple to remain activated MDCRipple: Context menu causes ripple to remain activated Sep 6, 2018
@kfranqueiro kfranqueiro added this to the R20 milestone Sep 25, 2018
@kfranqueiro kfranqueiro self-assigned this Oct 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants