Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(slide-toggle): Clicking on mat-slide-toggle element does not toggles the input, but sets :active pseudo selector visually indicating a click #29483

Closed
1 task
Totati opened this issue Jul 25, 2024 · 1 comment · Fixed by #29514
Assignees
Labels
area: material/slide-toggle P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Totati
Copy link
Contributor

Totati commented Jul 25, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Slide toggle toggles it's value on button or label click only, but because of the .mat-mdc-slide-toggle:active .mdc-switch:not(.mdc-switch--disabled) .mdc-switch__handle selector clicking on the "container" of the button and label triggers visual press on the element.

Reproduction

StackBlitz link
Steps to reproduce:

  1. Click on the pink area
  2. The handle size changes without toggling the button.

Expected Behavior

It should toggle the button or do not trigger the size change.

Actual Behavior

It triggers the size change.

Environment

Angular CLI: 18.0.2
Node: 18.20.3
Package Manager: yarn 1.22.19
OS: linux x64

Angular: 18.0.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1800.2
@angular-devkit/build-angular 18.0.2
@angular-devkit/core 18.0.2
@angular-devkit/schematics 18.0.2
@angular/cdk 18.1.2
@angular/cli 18.0.2
@angular/material 18.1.2
@angular/material-experimental 18.1.2
@angular/material-moment-adapter 18.1.2
@schematics/angular 18.0.2
rxjs 7.4.0
typescript 5.4.5
zone.js 0.14.6

@Totati Totati added the needs triage This issue needs to be triaged by the team label Jul 25, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/slide-toggle and removed needs triage This issue needs to be triaged by the team labels Jul 25, 2024
@crisbeto crisbeto self-assigned this Jul 30, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 30, 2024
Fixes that the clickable area of the slide toggle was only on the `button` itself and the `label` which meant that there was some space above and below the label which isn't clickable.

Fixes angular#29483.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 30, 2024
Fixes that the clickable area of the slide toggle was only on the `button` itself and the `label` which meant that there was some space above and below the label which isn't clickable.

Fixes angular#29483.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 30, 2024
Fixes that the clickable area of the slide toggle was only on the `button` itself and the `label` which meant that there was some space above and below the label which isn't clickable.

Fixes angular#29483.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 30, 2024
…tainer

Fixes that the slide toggle was triggering the `:active` styles for the entire container, even though only parts of it are interactive.

Fixes angular#29483.
crisbeto added a commit that referenced this issue Jul 30, 2024
…tainer (#29514)

Fixes that the slide toggle was triggering the `:active` styles for the entire container, even though only parts of it are interactive.

Fixes #29483.
crisbeto added a commit that referenced this issue Jul 30, 2024
…tainer (#29514)

Fixes that the slide toggle was triggering the `:active` styles for the entire container, even though only parts of it are interactive.

Fixes #29483.

(cherry picked from commit 5892acf)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/slide-toggle P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants