Skip to content

Commit

Permalink
fix(material/slider): handle contextmenu events (angular#27227)
Browse files Browse the repository at this point in the history
* fix(material/slider): handle contextmenu events

fixes issue angular#27225

* fixup! fix(material/slider): handle contextmenu events

* fixup! fix(material/slider): handle contextmenu events
  • Loading branch information
wagnermaciel authored Jun 6, 2023
1 parent 06aa8e5 commit 6a85c29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/material/slider/slider-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan
}

override _onPointerDown(event: PointerEvent): void {
if (this.disabled) {
if (this.disabled || event.button !== 0) {
return;
}
if (this._sibling) {
Expand Down
5 changes: 4 additions & 1 deletion src/material/slider/slider-thumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ export class MatSliderVisualThumb implements _MatSliderVisualThumb, AfterViewIni
this._hostElement.classList.remove('mdc-slider__thumb--focused');
};

private _onDragStart = (): void => {
private _onDragStart = (event: PointerEvent): void => {
if (event.button !== 0) {
return;
}
this._isActive = true;
this._showActiveRipple();
};
Expand Down

0 comments on commit 6a85c29

Please sign in to comment.