Skip to content

Commit

Permalink
fix(slider): Reorder such that dragstart event is emitted before any …
Browse files Browse the repository at this point in the history
…other events when handling drag start.

PiperOrigin-RevId: 393130257
  • Loading branch information
joyzhong authored and Copybara-Service committed Aug 26, 2021
1 parent e8554db commit 877e3fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mdc-slider/foundation.ts
Expand Up @@ -568,11 +568,11 @@ export class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {
*/
private handleDragStart(
event: PointerEvent|MouseEvent|TouchEvent, value: number, thumb: Thumb) {
this.adapter.emitDragStartEvent(value, thumb);

this.adapter.focusInput(thumb);
// Prevent the input (that we just focused) from losing focus.
event.preventDefault();

this.adapter.emitDragStartEvent(value, thumb);
}

/**
Expand Down

0 comments on commit 877e3fb

Please sign in to comment.