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:
Kristiyan Kostadinov
2017-06-08 23:33:14 +02:00
committed by Andrew Seguin
parent 4b98f21bd2
commit 1e92545465
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -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>
+3 -3
View File
@@ -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;