components icon indicating copy to clipboard operation
components copied to clipboard

fix(material/list): add radio toggles

Open zarend opened this issue 1 year ago • 3 comments

fix(material/list): add radio toggles

Add radio toggles for single selection. Fix a11y issue where selected state is visually communicated with color alone.

Rename checkboxPosition Input to togglePosition and deprecate checkboxPosition. togglePosition configures the position of both the radio and checkbox indicators. checkboxPosition also configures the position of both.

Summary of API and behavior changes:

  • MDC List displays radio indicators for single-selection
  • rename checkboxPosition Input to togglePosition
  • rename type MatListOptionCheckboxPosition to type MatListOptionTogglePosition

DEPRECTED:

  • checkboxPosition is deprecated because togglePosition replaces it
  • MatListOptionCheckboxPosition is deprecated because MatListOptionTogglePosition replaces it

Closes https://github.com/angular/components/issues/7157, Fixes https://github.com/angular/components/issues/25900

zarend avatar Nov 07 '22 16:11 zarend

Hi all, I've made fixes to respond to PR comments

  • update the code comments: say checkbox/radio or toggle instead of just checkbox
  • delete MatListOptionCheckboxPosition and @Input checkboxPosition, which are replaced by MatListOptionTogglePosition and @Input togglePosition
  • add getRadioPosition method to test harness

@crisbeto does this PR look good to you?

zarend avatar Nov 09 '22 04:11 zarend

I've made fixed based on PR comments and changed the target to minor:

  • checkboxPosition is deprecated because togglePosition replaces it
  • MatListOptionCheckboxPosition is deprecated because MatListOptionTogglePosition replaces it
  • export MatListOptionCheckboxPosition using the export as syntax 👌

@crisbeto @mmalerba this is ready for your eyes again :eyes:

zarend avatar Nov 09 '22 21:11 zarend

changes since this was last reviewed:

  • fixed regression in radio dark mode because MDC's global variables were not configured correctly
  • consolidated calls to using-mdc-theme

zarend avatar Nov 17 '22 18:11 zarend

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.