Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sliders mouseup is not firing when leaving the window #5184

Merged
merged 147 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
0971fb3
Horizontal-scroll tests cleanup
Aug 9, 2021
bcff915
Change files
Aug 9, 2021
9fb6bcc
Merge branch 'master' into users/robarb/tests-horizontal-scroll
robarbms Aug 11, 2021
802461c
Awaiting dom update to run test
Sep 10, 2021
bc4f117
Merge branch 'users/robarb/tests-horizontal-scroll' of https://github…
Sep 10, 2021
d8beac4
Merge branch 'master' into users/robarb/tests-horizontal-scroll
robarbms Sep 10, 2021
d7779ed
Merge branch 'master' into users/robarb/tests-horizontal-scroll
robarbms Sep 10, 2021
1de8e1f
Merge branch 'master' into users/robarb/tests-horizontal-scroll
robarbms Sep 10, 2021
1d9477a
Merge branch 'master' of https://github.com/microsoft/fast into users…
Sep 10, 2021
937788a
Merge branch 'users/robarb/tests-horizontal-scroll' of https://github…
Sep 10, 2021
842af7c
Merge branch 'master' of https://github.com/microsoft/fast into users…
Sep 13, 2021
194c4d0
fix: slider mouseup doesn't fire out of window
Sep 13, 2021
eadc416
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 14, 2021
5f2dcf8
Horizontal-scroll tests cleanup
Aug 9, 2021
76b0b7d
Change files
Aug 9, 2021
8ac0094
Awaiting dom update to run test
Sep 10, 2021
b4a9c5a
feat: add file component to creator for adding images (#5042)
williamw2 Aug 9, 2021
4bcc587
remove css color assignment from body of storybook to ensure there mi…
chrisdholt Aug 9, 2021
a2d3585
chore: eslint fixes in fast-components (#5005)
m4thieulavoie Aug 10, 2021
d60ad2e
applying package updates
Aug 10, 2021
ec69f67
docs(fast-frame): correct the style composition example (#5043)
EisenbergEffect Aug 10, 2021
d9c0199
fix: update html render navigation to use custom title if present (#5…
williamw2 Aug 10, 2021
a34a51b
applying package updates
Aug 11, 2021
2d95ef9
chore: eslint fixes in fast-foundation (#5008)
m4thieulavoie Aug 11, 2021
b80193c
ensure named slots are all accounted for as children and fix an issue…
janechu Aug 11, 2021
f54cc1f
feat: add fonts during registration (#5031)
janechu Aug 11, 2021
450ef04
fix: dialog focuses internally on launch (#5021)
Aug 11, 2021
574702d
docs: re-organize content for better navigation and discovery (#5052)
EisenbergEffect Aug 11, 2021
baea8dc
applying package updates
Aug 12, 2021
028d585
Various fixes to the Navigation Drag and Drop functionality (#5055)
janechu Aug 12, 2021
fbf5ced
feat: add PaletteRGB.from() API to support easier creation of palette…
nicholasrice Aug 13, 2021
82e8336
applying package updates
Aug 15, 2021
7502059
feat: add auto select option to html render inline edit component (#5…
williamw2 Aug 16, 2021
656c40c
update to content security policy for images and fonts (#5076)
awentzel Aug 16, 2021
6d818e9
fix: make resize observer target configurable in html render navigati…
williamw2 Aug 16, 2021
cf009f2
increase font size in editor (#5079)
williamw2 Aug 16, 2021
8afd985
applying package updates
Aug 17, 2021
1bef7d5
Focus and select text when navigation items are double clicked and ad…
janechu Aug 17, 2021
f3eae16
Add tooltips to the CSS layout radio buttons (#5082)
janechu Aug 17, 2021
6f00182
applying package updates
Aug 18, 2021
2dc1a54
fix: toolbar focus keyboarding sequence (#4984)
SethDonohue Aug 18, 2021
8a6c454
applying package updates
Aug 19, 2021
3348694
Default to the fluent ui design system and tokens (#5086)
janechu Aug 19, 2021
83b9f01
Resolves an issue where the CSS layout would not update when style wa…
janechu Aug 19, 2021
5cce525
fix: color picker value update bug (#5096)
williamw2 Aug 20, 2021
5714ec3
applying package updates
Aug 22, 2021
ac1d2a8
fix menu-item checked-indicator foreground color (#5010)
ben-girardet Aug 22, 2021
a77785b
applying package updates
Aug 23, 2021
289a4ae
add a list of linked data that cannot be dropped to (#5103)
janechu Aug 24, 2021
15a6fd9
allow custom Horizontal Scroller flippers to be context-driven Flippe…
radium-v Aug 24, 2021
c36a3a0
fix: broken build in todo app (#5004)
m4thieulavoie Aug 24, 2021
26f61f3
Fix example to include fastButton registration (#5105)
cnunciato Aug 24, 2021
b810359
applying package updates
Aug 25, 2021
d9deefd
Updated the default fill color to neutral layer 1 (#5091)
bheston Aug 25, 2021
61b904d
add doc for "why web components" and update FAQ (#5094)
chrisdholt Aug 25, 2021
7219ed7
the linked data removal button and the dropdown arrow will not displa…
janechu Aug 25, 2021
e954740
deep nested and multiple additional nodes were not created using a pr…
janechu Aug 25, 2021
845e4e5
feat(fast-element): make the task queue resilient to task exceptions …
EisenbergEffect Aug 25, 2021
263d474
Fix slider dragging when the page is scrolled (#5080)
claviska Aug 26, 2021
b3f1511
fix typings so that PaletteRGB.from supports plain objects (#5104)
nicholasrice Aug 26, 2021
3ac8282
applying package updates
Aug 26, 2021
14b6f0d
Enable async tests in fast-benchmark (#5109)
nicholasrice Aug 26, 2021
176c156
Add up/down support to number field (#5081)
claviska Aug 26, 2021
5a7039f
Fix: Refactor DesignToken implementation to support deep dependency h…
nicholasrice Aug 26, 2021
8121b59
Fixing incorrect HTMLStyleElement ordering in StyleElementStyles (#5113)
nicholasrice Aug 26, 2021
5a257cd
applying package updates
Aug 27, 2021
31024f3
fix: security-update-bump tar to 4.4.15 or later (#5035)
Ibrahimmaga Aug 27, 2021
57fe7fb
Fixed website fill color darkness (#5115)
bheston Aug 27, 2021
ae45a45
upgrade @npmcli/git to 2.1.0 (#5098)
Ibrahimmaga Aug 27, 2021
1d65a64
docs(integrations): add an ember tutorial (#5112)
EisenbergEffect Aug 30, 2021
80e5435
docs: add an apps and experiences section with the first DI article (…
EisenbergEffect Aug 30, 2021
77f1e87
Fixing DesignToken subscription bug causing runtime error (#5122)
nicholasrice Aug 30, 2021
f8b54b0
applying package updates
Aug 30, 2021
7421c90
fix: use await to import the registration script to prevent fast comp…
janechu Aug 31, 2021
3765ac9
Don't trap keys while slider has focus (#5118)
claviska Sep 1, 2021
b9d3357
feat: add viewport lock to tooltip (#4990)
Sep 1, 2021
97e4ede
applying package updates
Sep 1, 2021
9c03e17
fix: determinate progress bar's width should account for min/max attr…
Sep 1, 2021
2e0a237
lock yarn to a specific version (#5141)
chrisdholt Sep 1, 2021
aea6dfb
chore: update boilerplate text to be consistent (#5146)
janechu Sep 1, 2021
a477008
fix: improve CSSDesignToken performance (#5147)
nicholasrice Sep 1, 2021
74b8365
fix: ensure that all components (custom and native) have filled compo…
janechu Sep 1, 2021
c7c81a4
feat: allow an autocomplete in the form to use an alias (#5148)
janechu Sep 1, 2021
6360fbb
chore: remove the fluent ui card example from the creator (#5143)
janechu Sep 1, 2021
fdc4f70
Removed remaining 'use-defaults' which no longer exists (#5145)
bheston Sep 2, 2021
e6698f7
applying package updates
Sep 2, 2021
31ab05a
feat(design-system): enable complete ignore of duplicate elements (#5…
EisenbergEffect Sep 2, 2021
712a46c
applying package updates
Sep 2, 2021
8ffc68c
bump path-parse to 1.0.7 (#5084)
Ibrahimmaga Sep 2, 2021
be53b9b
updata accordion, anchor and button add a few tokens and recipes
khamudom Aug 19, 2021
6c71d80
updating styles add recipe and design tokens
khamudom Aug 26, 2021
a281159
rebased and resolve conflicts
khamudom Aug 26, 2021
8bc2e1b
update tokens, input and menu-item styles
khamudom Aug 27, 2021
46cd16e
addressed high contrast issues
khamudom Aug 27, 2021
5ff4306
update input type components, tab and slider
khamudom Aug 31, 2021
dedd412
updating class menu, select and tabs file. more color style updates
khamudom Aug 31, 2021
f7c883b
adjust delta to match design
khamudom Sep 3, 2021
b03447a
revert unintentionally committed commits (#5158)
nicholasrice Sep 7, 2021
e3e8f62
Explain DesignToken does not work with volatile bindings (#5151)
nicholasrice Sep 7, 2021
e7b6719
fix: security update bump jszip from 3.5.0 to 3.7.1 (#5097)
Ibrahimmaga Sep 7, 2021
ed1fe6b
fix: allow for base class (#4943)
m4thieulavoie Sep 7, 2021
d573f88
fix: add more image types to image upload in creator (#5154)
williamw2 Sep 7, 2021
262186e
add style property to fluent ui definitions (#5155)
williamw2 Sep 7, 2021
68dcfcc
feat: add margin, padding and width to css styles in creator (#5161)
williamw2 Sep 7, 2021
cc31627
fix(breadcrumb-item): add display flex to separator (#5152)
ben-girardet Sep 7, 2021
5f3b4b0
perf(Controller): reduce object allocation needed for isConnected pro…
EisenbergEffect Sep 8, 2021
5df9bd3
applying package updates
Sep 8, 2021
ae68c43
fix(design-system): make FoundationElement.compose safe to use direct…
EisenbergEffect Sep 8, 2021
18597b1
chore: update the change event to be input for CSS text input (#5164)
janechu Sep 8, 2021
7e97757
support default slotted content start end (#5140)
chrisdholt Sep 8, 2021
83c256c
feat: add a message queue to the message system (#5163)
janechu Sep 8, 2021
11403ec
feat(fast-components): leverage FoundationElement.compose baseClass (…
EisenbergEffect Sep 8, 2021
49c9d05
applying package updates
Sep 9, 2021
ec06caa
feat: add option to html renderer inline edit to commit changes on bl…
williamw2 Sep 9, 2021
9a9683b
chore: add an alias for the image html element (#5172)
janechu Sep 9, 2021
6d75aa8
fix: fixed html renderer exception in some messaging scenarios (#5174)
williamw2 Sep 9, 2021
70aa414
fix: resolve an issue where linked data that cannot be dropped on was…
janechu Sep 9, 2021
5f505a0
add custom fast-frame controls for browsers with eyedropper support (…
radium-v Sep 10, 2021
4274fdf
Tab panel display (#5173)
claviska Sep 10, 2021
7853110
throw an error when comments in CSS contain expressions (#5156)
radium-v Sep 10, 2021
6e0a8f5
update fast-tab-panel to display flex on website fast-frame panel (#5…
chrisdholt Sep 10, 2021
c64a2f2
fix: use `key` instead of `keycode` to identify keystrokes (#5162)
Sep 10, 2021
cc26fc8
fix: security update axios from 0.21.1 to 0.21.4 (#5178)
Ibrahimmaga Sep 10, 2021
4703fda
fix: small updates to styling to correct for overflow issues (#5179)
janechu Sep 10, 2021
1d9282a
applying package updates
Sep 12, 2021
9a819ab
fix: slider mouseup doesn't fire out of window
Sep 13, 2021
cde7c9a
Using a manual focus to workaround delegatesFocus issues on Firefox (…
jumarroq Sep 13, 2021
145394a
chore: mark the fast-tooling and fast-tooling-react packages as priva…
janechu Sep 14, 2021
218cadc
applying package updates
Sep 14, 2021
89b251f
Add Skeleton container example in component explorer (#5153)
litteredwitherrors Sep 15, 2021
dc1e68a
applying package updates
Sep 15, 2021
d81d2f8
Merge branch 'master' of https://github.com/microsoft/fast into users…
Sep 15, 2021
7758d3d
Merge branch 'users/robarb/slider-mouseup' of https://github.com/micr…
Sep 15, 2021
a43cf26
Merge branch 'master' of https://github.com/microsoft/fast into users…
Sep 15, 2021
f90bc4b
Merge branch 'users/robarb/slider-mouseup' of https://github.com/micr…
Sep 15, 2021
1d1208d
Undoing horizontal-scroll changes
Sep 15, 2021
b0b46a8
Updating change file
Sep 15, 2021
6867baa
Making sure all events are removed.
Sep 15, 2021
889959a
Updating stopDragging()
Sep 15, 2021
b99bb25
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 15, 2021
5445827
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 16, 2021
65dd9a7
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 23, 2021
26c80dc
Consolidation of logic
Sep 24, 2021
6aee49f
setupListeners can remove its attached listeners
Sep 24, 2021
72c9543
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 27, 2021
24647bb
Merge branch 'master' into users/robarb/slider-mouseup
robarbms Sep 28, 2021
0c54578
Merge branch 'master' into users/robarb/slider-mouseup
chrisdholt Sep 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: sliders mouseup is not firing when leaving the window",
"packageName": "@microsoft/fast-foundation",
"email": "robarb@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe("HorinzontalScroll", () => {
await disconnect();
}, 1);
});

it("should change scroll stop on resize", async () => {
const { element, connect, disconnect } = await setup();

Expand Down
80 changes: 45 additions & 35 deletions packages/web-components/fast-foundation/src/slider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,9 @@ export class Slider extends FormAssociatedSlider implements SliderConfiguration
* @internal
*/
public disconnectedCallback(): void {
this.removeEventListener("keydown", this.keypressHandler);
this.removeEventListener("mousedown", this.handleMouseDown);
this.thumb.removeEventListener("mousedown", this.handleThumbMouseDown);
this.thumb.removeEventListener("touchstart", this.handleThumbMouseDown);
this.setupListeners(true);
this.handleThumbMouseDown(null, true);
this.handleMouseDown(null, true);
}

/**
Expand Down Expand Up @@ -361,11 +360,12 @@ export class Slider extends FormAssociatedSlider implements SliderConfiguration
}
};

private setupListeners = (): void => {
this.addEventListener("keydown", this.keypressHandler);
this.addEventListener("mousedown", this.handleMouseDown);
this.thumb.addEventListener("mousedown", this.handleThumbMouseDown);
this.thumb.addEventListener("touchstart", this.handleThumbMouseDown);
private setupListeners = (remove: boolean = false): void => {
const eventAction = `${remove ? "remove" : "add"}EventListener`;
this[eventAction]("keydown", this.keypressHandler);
this[eventAction]("mousedown", this.handleMouseDown);
this.thumb[eventAction]("mousedown", this.handleThumbMouseDown);
this.thumb[eventAction]("touchstart", this.handleThumbMouseDown);
};

/**
Expand Down Expand Up @@ -394,17 +394,23 @@ export class Slider extends FormAssociatedSlider implements SliderConfiguration
/**
* Handle mouse moves during a thumb drag operation
*/
private handleThumbMouseDown = (event: MouseEvent): void => {
if (this.readOnly || this.disabled || event.defaultPrevented) {
private handleThumbMouseDown = (
event: MouseEvent | null,
remove: boolean = false
): void => {
if (this.readOnly || this.disabled || (event && event.defaultPrevented)) {
return;
}
event.preventDefault();
(event.target as HTMLElement).focus();
window.addEventListener("mouseup", this.handleWindowMouseUp);
window.addEventListener("mousemove", this.handleMouseMove);
window.addEventListener("touchmove", this.handleMouseMove);
window.addEventListener("touchend", this.handleWindowMouseUp);
this.isDragging = true;
if (event) {
event.preventDefault();
(event.target as HTMLElement).focus();
}
const eventAction = `${remove ? "remove" : "add"}EventListener`;
window[eventAction]("mouseup", this.handleWindowMouseUp);
window[eventAction]("mousemove", this.handleMouseMove);
window[eventAction]("touchmove", this.handleMouseMove);
window[eventAction]("touchend", this.handleWindowMouseUp);
this.isDragging = remove === false;
};

/**
Expand Down Expand Up @@ -453,26 +459,30 @@ export class Slider extends FormAssociatedSlider implements SliderConfiguration

private stopDragging = (): void => {
this.isDragging = false;
window.removeEventListener("mouseup", this.handleWindowMouseUp);
window.removeEventListener("mousemove", this.handleMouseMove);
window.removeEventListener("touchmove", this.handleMouseMove);
window.removeEventListener("touchend", this.handleWindowMouseUp);
this.handleMouseDown(null, true);
this.handleThumbMouseDown(null, true);
};

private handleMouseDown = (e: MouseEvent) => {
e.preventDefault();
private handleMouseDown = (e: MouseEvent | null, remove: boolean = false) => {
if (e) {
e.preventDefault();
}
if (!this.disabled && !this.readOnly) {
this.setupTrackConstraints();
(e.target as HTMLElement).focus();
window.addEventListener("mouseup", this.handleWindowMouseUp);
window.addEventListener("mousemove", this.handleMouseMove);

const controlValue: number =
this.orientation === Orientation.horizontal
? e.pageX - document.documentElement.scrollLeft - this.trackLeft
: e.pageY - document.documentElement.scrollTop;

this.value = `${this.calculateNewValue(controlValue)}`;
const eventAction = `${remove ? "remove" : "add"}EventListener`;
window[eventAction]("mouseup", this.handleWindowMouseUp);
window.document[eventAction]("mouseleave", this.handleWindowMouseUp);
window[eventAction]("mousemove", this.handleMouseMove);

if (e) {
this.setupTrackConstraints();
(e.target as HTMLElement).focus();
const controlValue: number =
this.orientation === Orientation.horizontal
? e.pageX - document.documentElement.scrollLeft - this.trackLeft
: e.pageY - document.documentElement.scrollTop;

this.value = `${this.calculateNewValue(controlValue)}`;
}
}
};

Expand Down