mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(button-toggle): remove redundant blocking touchstart listener (#4947)
Removes an unnecessary `touchstart` listener on the button toggle. It was initially added to prevent it from capturing user events, however it's no longer necessary, because we have `pointer-events: none` on the element. This also fixes a warning that is being logged by Chrome. Fixes #4221.
This commit is contained in:
committed by
Andrew Seguin
parent
4b98f21bd2
commit
1e92545465
@@ -12,5 +12,4 @@
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</label>
|
||||
<!-- the touchstart handler prevents the overlay from capturing the initial tap on touch devices -->
|
||||
<div class="mat-button-toggle-focus-overlay" (touchstart)="$event.preventDefault()"></div>
|
||||
<div class="mat-button-toggle-focus-overlay"></div>
|
||||
|
||||
@@ -55,11 +55,11 @@ $mat-button-toggle-border-radius: 2px !default;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Overlay to be used as a tint. Note that the same effect can be achieved by using a pseudo
|
||||
// element, however we use a proper DOM element in order to be able to disable the default
|
||||
// touch action. This makes the buttons more responsive on touch devices.
|
||||
// Overlay to be used as a tint.
|
||||
.mat-button-toggle-focus-overlay {
|
||||
border-radius: inherit;
|
||||
|
||||
// Disable pointer events to prevent it from hijacking user events.
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
@include mat-fill;
|
||||
|
||||
Reference in New Issue
Block a user