question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat(mat-selection-list): add slide toggle as alternative for checkbox

See original GitHub issue

Bug, feature request, or proposal:

feature request

What is the expected behavior?

Option lists can have slide toggles instead of checkboxes, as you can see on Android OS.

What is the current behavior?

Option lists are only for checkboxes and if you want to create something that has the same look but has a slide toggle instead, you will have to implement by yourself.

What is the use-case or motivation for changing an existing behavior?

Its a very common option list format, very used on Android 5~6.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material 5.1

Is there anything else we should know?

You can find it in Material’s guidelines: image (switches are very cute btw)

Cute sidebar example: image (inspired by Twitter’s PWA, achieved with slide-toggle, mat-list and ::ng-deep, that’s a lot more than I expect to write)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:14
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
devversioncommented, Feb 12, 2018

cc. @jelbourn

This would be actually pretty easy to implement. We could have something like a [indicatorType] input binding that allows deciding which indicator to use (e.g. checkbox, slide-toggle).

It just feels a bit unfortunate, that we would need to have a dependency on the MatSlideToggleModule. We could fix that by either letting the user project the indicator manually, or by having a separate module for the selection list.

https://gyazo.com/82a69f9a3f2d4a73693dbde2efe9e6cd

0reactions
angular-robot[bot]commented, Feb 21, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change VISUAL state on Angular mat-slide-toggle and ...
After trial and error, I found the following solution: <mat-slide-toggle formControlName="onlineOnly" [checked]="onlineOnlyChecked">Online ...
Read more >
angular/cdk - Awesome JS
listbox: set initial focus to selected option (#26174) ... feat - 8554e1538 ... schematics: add slide toggle styles migrator and tests. feat -...
Read more >
Slide toggle | Angular Material
<mat-slide-toggle> is an on/off control that can be toggled via clicking. ... Slide me! The slide-toggle behaves similarly to a checkbox, though it...
Read more >
components: CHANGELOG.md - Fossies
f61a21382, fix, select: changed after checked error if option label changes ... 7646c73c32, feat, schematics: add slide toggle styles migrator and tests.
Read more >
angular/material - Gitter
mat-selection-list .mat-list-option { display: block; height: 48px; How can I override these class and remove the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found