-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update the SDP and DRP to be compatible with react-with-direction #1482
Conversation
2229c31
to
995f983
Compare
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.
Instead of an isRTL prop, can we not use withDirection?
@ljharb We considered introducing This PR hopes to prevent the collision between the manual flipping and the automatic flipping in the event that these components are wrapped in a |
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.
Thanks so much, @majapw !
This change prevents automatic flipping on styles that are manually handled via the isRTL prop. Co-Authored-By: majapw <majapw@gmail.com>
540642a
to
f4535de
Compare
@ljharb can you take another look? |
@@ -67,12 +67,12 @@ export default withStyles(({ reactDates: { color } }) => ({ | |||
KeyboardShortcutRow_keyContainer: { | |||
display: 'inline-block', | |||
whiteSpace: 'nowrap', | |||
textAlign: 'right', | |||
marginRight: 6, | |||
textAlign: 'right', // is not handled by isRTL |
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.
Does that mean these should have a todo?
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.
I think once we got to the keyboard shortcuts, we realized that this panel has just never been considered for RTL. So maybe? I think that is an open question.
|
In react-dates#1482 we added compatibility with react-with-direction. In the process we created a helper utility `noflip` to make it so that react-with-direction wouldn't interfere with the preexisting `isRTL` flag. This PR fixes the noflip behavior for Numbers, and adds unit tests.
In #1482 we added compatibility with react-with-direction. In the process we created a helper utility `noflip` to make it so that react-with-direction wouldn't interfere with the preexisting `isRTL` flag. This PR fixes the noflip behavior for Numbers, and adds unit tests.
* [a11y] Move triangular border styles to :before pseudo element, fixing lack of visible focus in Firefox and IE * [a11y] Remove space/enter onKeyDown handling for open/close keyboard shortcuts panel * Disable navigation controllers based on min and max date * Add stories * Early return if not a moment object * Tests for block navigation * Use disabled colors in navigation * Rename to disablePrev/Next so the default is falsy * disable navigation onKeyUp * aria-disabled in navigation button * Rename to shouldDisableMonthNavigation * Init disablePrev and disableNext in component state * Fix indentation * Fallback to undefined in aria-disabled when not disabled Co-Authored-By: pedroabreu <pmig.abreu@gmail.com> * pre-populate state depending on initial props * disable onMouseUp event by disable prop * Update the SDP and DRP to be compatible with react-with-direction This change prevents automatic flipping on styles that are manually handled via the isRTL prop. Co-Authored-By: majapw <majapw@gmail.com> * Version 18.3.0 * [RTL] Fix the SDP and DRP noflip util function In react-dates#1482 we added compatibility with react-with-direction. In the process we created a helper utility `noflip` to make it so that react-with-direction wouldn't interfere with the preexisting `isRTL` flag. This PR fixes the noflip behavior for Numbers, and adds unit tests. * Version 18.3.1 * Add bug report issue template * Add `openDirection` prop to README * Clarify VoiceOver text for dates selected as check-in and check-out * fixed tests * addressed comments * Version 18.4.0 * Add children to DateRangePicker * Fix lint error * Single Date Picker focus fix * Move calendar date picker to currently focused input element * Fix issue with onKeyDownTab * Remove ternary usage * Fix wrong comparison :) * Update src/components/SingleDatePicker.jsx Co-Authored-By: monokrome <github@monokro.me> * Remove unnecessary `children` prop. * Remove .cache from .gitignore * Revert "Remove unnecessary `children` prop." This reverts commit f5d58d5. * [SUGGESTION] Push events through onBlur/onTab callbacks * Call into onClose on focusout for keyboard navigation * Fix a number of linting issues * Fix specs. * Fix issue caused when relatedTarget is sometimes null. * Add comment explaining why we are using focusout here. * Fix issues with inconsistencies handling events between date pickers. * Fix issue where children had no default props. * Add tests ensuring that DateRangePicker focusout works as expected. * Add a comment explaining what is happening here. * Rename to `currentDateOffset` I'm worried that maybe this feels a bit redundant since anything in `this.state` should be "current", but it does help to solve the issue w/ naming being weird?... * Prevent redundancy by renaming local instead of state. * Only show children if focused. Using `children &&` was odd. * Using `focused &&` broke a test, but plain `{children}` should work. * Fix issue using `this.state` as opposed to deconstructed value. * Version 18.4.1 * Add aria-disabled prop to CalendarDay and CustomizableCalendarDay * [Dev Deps] update `why-did-you-update` * Add date offset functionality to DateRangePicker * Add tests to demonstrate how logic of onDatesChange can affect onFocusChange
This change prevents automatic flipping on styles that are manually handled via the isRTL prop.
to: @airbnb/ui-frameworks @ljharb @yzimet