[DateRangePicker] Fix not being opened on click#26016
Merged
Conversation
eps1lon
added a commit
to siriwatknp/material-ui
that referenced
this pull request
Apr 29, 2021
siriwatknp
added a commit
that referenced
this pull request
May 12, 2021
* migrate to emotion * make styleProps optional * remove lint and add fn name * use yearButton from styles * revert types * [docs] Document all the colors available (#26015) * [Timeline] Add support for position override on items (#25974) * [core] Remove deprecated innerRef prop (#26028) [core] Remove deprecated innerRef prop (#26028) * [theme] Rename `createMuiTheme` to `createTheme` (#25992) * [pickers] Remove redundant aria-hidden (#26014) * [internal][pickers] Remove unused styles (#26023) * [pickers] Toggle mobile keyboard view in the same commit as the view changes (#26017) * [DateRangePicker] Fix not being opened on click (#26016) * Inline classes * type -> interface * sort asc * default props are private * remove uneccesary type casting * follow convention * trigger pipeline Co-authored-by: Anshuman Pandey <54475686+anshuman9999@users.noreply.github.com> Co-authored-by: simonecervini <69400730+simonecervini@users.noreply.github.com> Co-authored-by: Matheus Wichman <matheushw@outlook.com> Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com> Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #24937
Note that this will break existing tests if you just fired
clickevents.I'm at the point where I do think the "activate on mousedown" is better than "activate in the next event loop cycle". To fix facebook/react#20074 we either have to arm on mousedown or use a timer based approach described in https://gist.github.com/bvaughn/fc1c3f27f1aab91c7378f2264f7c3aa1.
So both approaches result in breaking tests. Though with timer based approaches it's much harder to communicate how to test. Is "next event loop cycle" part of the public testing API? How do people discover this? Both of these questions cost us already a lot of time (see popperjs) and are still breaking tests. "activate on mousedown" gives a deterministic API that is already compatible with browser instrumentation (playwright, puppeteer). And saying that "mousedown before click must be dispatched" is far less exotic and even increases test confidence.
Same approach as #25741 but only applied to pickers. It's easier to apply to just PickersPopper since that component is internal.
Manual testing:
https://deploy-preview-26016--material-ui.netlify.app/components/date-range-picker/#basic-usage
https://deploy-preview-26016--material-ui.netlify.app/components/date-picker/#basic-usage