Open rbare1 opened 5 years ago
Can you show me your code with Stackblitz or Codepen? I tried to reproduce this issue in MacOS but failed.
https://github.com/material-components/material-components-web/blob/5e294f9f969d6fa3718ff2115e1a64bdba1cf241/packages/mdc-list/foundation.ts#L244-L257
Now handleClick
doesn't check prop singleSelection
.
@moog16 It seems this issue is from mdc-web. Can you move this issue there? And then I'll create a fixing PR!
@TroyTae is it possible that we are just on an older version of mdc web? Has this already been fixed in 3.0?
In v0.13.0, the singleSelection list can't be used without the handleSelect prop. Previously, it would handle selected state properly on its own, but now it won't remove the selected class when selecting another option. Additionally, if you click around quickly, sometimes the previous list item will deselect.
This can be recreated with the screenshot tests by simply removing the handleSelect prop from the SelectionListTest.
v0.12.0:![2019-06-04_15-53-15](https://user-images.githubusercontent.com/3473227/58885170-02d8bc00-86e2-11e9-9359-761c116310dc.gif)
v0.13.0![2019-06-04_15-57-28](https://user-images.githubusercontent.com/3473227/58885177-0704d980-86e2-11e9-8148-173bd6cb2791.gif)