Rmwc: Button remains in focus after click if "disabled" flag set by state.

Created on 8 Nov 2019  路  7Comments  路  Source: jamesmfriedman/rmwc

I have a few buttons that are enabled or disabled based on state (passed down as prop, but that doesn't seem relevant).

Once they have been clicked they retain the mdc-ripple-upgraded--background-focused class even if other buttons are clicked. The button can be enabled / disabled, but it is always "focused" when it is re-enabled.

This behaviour does not occur if the disabled property is not set, or is set by a static var.

Fixed in Upcoming Release bug

Most helpful comment

Fixin in 6.0.0.

All 7 comments

Can you make a quick repro in the code sandbox? The description is hard to follow.

Apologies, didn't have time to work this up earlier: https://codesandbox.io/s/rmwc-sandbox-6f16d

Can't attest this is a RMWC issue, though things behaved as expected with MDC React

Yeah thats really strange. Actively working on the next release so I'll make sure to get this in.

Blur isn't called when the state is changed to disabled, so the class is not removed by the foundation. Here is the fix in MDC React: material-components/material-components-web-react#943

Thanks for finding that, Will get fixed in the next release!

Fixin in 6.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robcaldecottvelo picture robcaldecottvelo  路  6Comments

kctang picture kctang  路  7Comments

nicholaschiang picture nicholaschiang  路  4Comments

jamesmfriedman picture jamesmfriedman  路  6Comments

alecchisi picture alecchisi  路  5Comments