Skip to content

Commit

Permalink
fix: ensure streamingListener ends even if pointercancel not fired
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Apr 13, 2023
1 parent fd17b00 commit 74105f2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/color-area/src/ColorArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,10 @@ export class ColorArea extends SpectrumElement {
${streamingListener({
start: ['pointerdown', this.handlePointerdown],
streamInside: ['pointermove', this.handlePointermove],
end: [['pointerup', 'pointercancel'], this.handlePointerup],
end: [
['pointerup', 'pointercancel', 'pointerleave'],
this.handlePointerup,
],
})}
></sp-color-handle>
Expand Down
5 changes: 4 additions & 1 deletion packages/color-slider/src/ColorSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ export class ColorSlider extends Focusable {
${streamingListener({
start: ['pointerdown', this.handlePointerdown],
streamInside: ['pointermove', this.handlePointermove],
end: [['pointerup', 'pointercancel'], this.handlePointerup],
end: [
['pointerup', 'pointercancel', 'pointerleave'],
this.handlePointerup,
],
})}
></sp-color-handle>
<input
Expand Down
5 changes: 4 additions & 1 deletion packages/color-wheel/src/ColorWheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ export class ColorWheel extends Focusable {
${streamingListener({
start: ['pointerdown', this.handlePointerdown],
streamInside: ['pointermove', this.handlePointermove],
end: [['pointerup', 'pointercancel'], this.handlePointerup],
end: [
['pointerup', 'pointercancel', 'pointerleave'],
this.handlePointerup,
],
})}
></sp-color-handle>
Expand Down
6 changes: 5 additions & 1 deletion packages/number-field/src/NumberField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,11 @@ export class NumberField extends TextfieldBase {
this.handlePointermove,
],
end: [
['pointerup', 'pointercancel'],
[
'pointerup',
'pointercancel',
'pointerleave',
],
this.handlePointerup,
],
})}
Expand Down
5 changes: 4 additions & 1 deletion packages/slider/src/Slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ export class Slider extends ObserveSlotText(SliderHandle, '') {
${streamingListener({
start: ['pointerdown', this.handlePointerdown],
streamInside: ['pointermove', this.handlePointermove],
end: [['pointerup', 'pointercancel'], this.handlePointerup],
end: [
['pointerup', 'pointercancel', 'pointerleave'],
this.handlePointerup,
],
})}
>
<div id="controls">
Expand Down

0 comments on commit 74105f2

Please sign in to comment.