Skip to content

Commit

Permalink
Update to latest Airbnb version (#10)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
zeljkoX authored Feb 7, 2019
1 parent 74bf927 commit d719595
Show file tree
Hide file tree
Showing 43 changed files with 1,124 additions and 360 deletions.
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**react-dates version**
e.g. react-dates@18.3.1

**Describe the bug**
A clear and concise description of what the bug is.

**Source code (including props configuration)**
Steps to reproduce the behavior:
```
<DateRangePicker
startDate={this.state.startDate}
startDateId="your_unique_start_date_id"
endDate={this.state.endDate}
endDateId="your_unique_end_date_id"
onDatesChange={({ startDate, endDate }) => this.setState({ startDate, endDate })}
focusedInput={this.state.focusedInput}
onFocusChange={focusedInput => this.setState({ focusedInput })}
/>
```
If you have custom methods that you are passing into a `react-dates` component, e.g. `onDatesChange`, `onFocusChange`, `renderMonth`, `isDayBlocked`, etc., please include the source for those as well.

**Screenshots/Gifs**
If applicable, add screenshots or gifs to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Is the issue reproducible in Storybook?**
Please link to the relevant storybook example

**Additional context**
Add any other context about the problem here.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ yarn.lock
package-lock.json

css/styles.css
<<<<<<< HEAD

# VS Code plugin that saves versions pre-commit & push
.history/
.history/
=======
>>>>>>> f596ba2bbc4e196327bf8b8418f80b401c34c935
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@
- [] ([#](https://github.com/airbnb/react-dates/pull/))
-->

##18.2.16
## 18.4.1
- [fix] Make DRP and SDP calendars tabbable from the inputs ([#1499](https://github.com/airbnb/react-dates/pull/1499))

- [Modify] - Styling update, match Lyric design
## 18.4.0
- [new] Clarify VoiceOver text for dates selected as start-date and end-date ([#1501](https://github.com/airbnb/react-dates/pull/1501))

##18.2.15
## 18.3.1
- [fix][RTL] Fix the SDP and DRP noflip util function ([#1492](https://github.com/airbnb/react-dates/pull/1492))

## 18.3.0
- [fix] Update the SDP and DRP to be compatible with `react-with-direction` ([#1482](https://github.com/airbnb/react-dates/pull/1482))
- [new] Add `minDate` and `maxDate` props to block month navigation ([#1311](https://github.com/airbnb/react-dates/pull/1311))
- [fix][a11y] Remove space/enter onKeyDown handling for open/close keyboard shortcuts panel ([#1464](https://github.com/airbnb/react-dates/pull/1464))
- [fix][a11y] Fix lack of visible focus in Firefox and IE on "?" keyboard shortcuts button ([#1463](https://github.com/airbnb/react-dates/pull/1463))

##18.2.16
- [Modify] - Styling update, match Lyric design

##18.2.15
- [Modify] - Update styling to match new design for homepage of Lyric

##18.2.14
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ regular: PropTypes.bool,
renderMonthText: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'), // (month) => PropTypes.string,
orientation: PropTypes.oneOf([HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION]),
anchorDirection: PropTypes.oneOf([ANCHOR_LEFT, ANCHOR_RIGHT]),
openDirection: PropTypes.oneOf([OPEN_DOWN, OPEN_UP]),
horizontalMargin: PropTypes.number,
withPortal: PropTypes.bool,
withFullScreenPortal: PropTypes.bool,
Expand Down Expand Up @@ -238,6 +239,7 @@ regular: PropTypes.bool,
renderMonthText: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'), // (month) => PropTypes.string,
orientation: PropTypes.oneOf([HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION]),
anchorDirection: PropTypes.oneOf([ANCHOR_LEFT, ANCHOR_RIGHT]),
openDirection: PropTypes.oneOf([OPEN_DOWN, OPEN_UP]),
horizontalMargin: PropTypes.number,
withPortal: PropTypes.bool,
withFullScreenPortal: PropTypes.bool,
Expand Down
4 changes: 4 additions & 0 deletions examples/DayPickerRangeControllerWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const propTypes = forbidExtraProps({
startDateOffset: PropTypes.func,
endDateOffset: PropTypes.func,
showInputs: PropTypes.bool,
minDate: momentPropTypes.momentObj,
maxDate: momentPropTypes.momentObj,

keepOpenOnDateSelect: PropTypes.bool,
minimumNights: PropTypes.number,
Expand Down Expand Up @@ -64,6 +66,8 @@ const defaultProps = {
startDateOffset: undefined,
endDateOffset: undefined,
showInputs: false,
minDate: null,
maxDate: null,

// day presentation and interaction related props
renderCalendarDay: undefined,
Expand Down
Loading

0 comments on commit d719595

Please sign in to comment.