-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[ClickAwayListener] Fix children
and onClickAway
types
#24565
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
211073d
[ClickAwayListener] Fix `children` and `onClickAway` types
eps1lon de37a9a
Fix types
eps1lon 4af02b7
Bail early when handling TouchEvent
eps1lon c0e7931
Exclude all test files
eps1lon f7280d1
remove unnecessary filke
eps1lon 370bf99
Fix downstream type issues
eps1lon bf908e9
Fix proptypes generation
eps1lon 885d4d7
yarn proptypes
eps1lon 71a97f1
Fix component annotation for function declarations
eps1lon 4ee27b3
f
eps1lon bc2b368
making sure merge commits dont break any workflow
eps1lon 569dcf4
Remove rogue auto-import
eps1lon 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function ownerDocument(node: Node | undefined): Document { | ||
export default function ownerDocument(node: Node | null | undefined): Document { | ||
return (node && node.ownerDocument) || document; | ||
} |
43 changes: 0 additions & 43 deletions
43
packages/material-ui/src/ClickAwayListener/ClickAwayListener.d.ts
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains 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
This file contains 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.
We used to access
event.clientX
on touch events which don't implement that property. So we would always end up evaluatingdoc.documentElement.clientWidth < undefined || doc.documentElement.clientHeight < undefined
. This always evaluates tofalse
so we can bail out early by checking if we have a MouseEvent.In the end we're forcing less layout on touch events (no access to
element.clientWidth
) but check property existence more often. Seems like a good tradeoff considering forcing layout is much more expensive than checking property existence and touch events are usually dispatched on weaker devices e.g. smartphones.