Skip to content

Commit

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

fixes issue #27225

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

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

(cherry picked from commit 6a85c29)
  • Loading branch information
wagnermaciel committed Jun 6, 2023
1 parent b6a9895 commit c19bd4c
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
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
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 c19bd4c

Please sign in to comment.