Skip to content

Commit 6a85c29

Browse files
authored
fix(material/slider): handle contextmenu events (#27227)
* fix(material/slider): handle contextmenu events fixes issue #27225 * fixup! fix(material/slider): handle contextmenu events * fixup! fix(material/slider): handle contextmenu events
1 parent 06aa8e5 commit 6a85c29

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/material/slider/slider-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan
637637
}
638638

639639
override _onPointerDown(event: PointerEvent): void {
640-
if (this.disabled) {
640+
if (this.disabled || event.button !== 0) {
641641
return;
642642
}
643643
if (this._sibling) {

src/material/slider/slider-thumb.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ export class MatSliderVisualThumb implements _MatSliderVisualThumb, AfterViewIni
172172
this._hostElement.classList.remove('mdc-slider__thumb--focused');
173173
};
174174

175-
private _onDragStart = (): void => {
175+
private _onDragStart = (event: PointerEvent): void => {
176+
if (event.button !== 0) {
177+
return;
178+
}
176179
this._isActive = true;
177180
this._showActiveRipple();
178181
};

0 commit comments

Comments
 (0)