-
Notifications
You must be signed in to change notification settings - Fork 2.9k
ContextualMenu: Update mousemove behavior #4589
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
Merged
jspurlin
merged 6 commits into
microsoft:master
from
jspurlin:jspurlin/ContextualMenuUpdateMouseMoveBehavior
Apr 18, 2018
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
20bc7da
ContextualMenu: Update mousemove to only do anything if there is not …
jspurlin 11bb565
rush change
jspurlin 0b996e5
change spacing
jspurlin 9f48835
Make sure we are clearing the enterTimerId after executing in the set…
jspurlin 8bb49e3
fix missing line to set enterTimerId back to undefined if the item do…
jspurlin aeb4bd7
Merge branch 'master' of https://github.com/jspurlin/office-ui-fabric…
jspurlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...fice-ui-fabric-react/jspurlin-ContextualMenuUpdateMouseMoveBehavior_2018-04-17-17-55.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "ContextualMenu: Update mousemove to only do anything if there is not another pending mouse enter/move/leave to improve the snappiness of the updates", | ||
| "type": "patch" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "[email protected]" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You actually do not need to do this. The following line of code will have the same affect and save you a few characters.
this._enterTimerId ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it shouldn't be zero if it is a valid id, I couldn't find anything that technically says zero is not a valid return value. I don't want to make any assumptions which might make this code more brittle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK sure. Your choice. I am certain it cannot be Zero. I know this because I have written such code more than once and never faced issues. That code has run for many years now.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
he returned timeoutID is a positive integer value which identifies the timer created by the call to setTimeout();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to IEEE 754-2008 zero can be signed and is positive by default (and can sometimes be negative), that being said it doesn't make sense to risk it