Skip to content

Commit

Permalink
Remove second autoFocus example (Hacker0x01#1390)
Browse files Browse the repository at this point in the history
* Remove second autoFocus example

hero_example already has autoFocus, and having two inputs
focused by default dosn't make sense.

Fixes Hacker0x01#1212 Hacker0x01#1334

* Fix flaky test again
  • Loading branch information
aij authored and martijnrusschen committed May 31, 2018
1 parent 8970e2c commit 67f05e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 48 deletions.
5 changes: 0 additions & 5 deletions docs-site/src/example_components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import ExcludeTimePeriod from "./examples/exclude_time_period";
import IncludeTimes from "./examples/include_times";
import InjectTimes from "./examples/inject_times";
import DontCloseOnSelect from "./examples/dont_close_onSelect";
import OpenByDefault from "./examples/open_by_default";

import "react-datepicker/dist/react-datepicker.css";
import "./style.scss";
Expand Down Expand Up @@ -252,10 +251,6 @@ export default class exampleComponents extends React.Component {
{
title: "Don't hide calendar on date selection",
component: <DontCloseOnSelect />
},
{
title: "Open calendar by default",
component: <OpenByDefault />
}
];

Expand Down
42 changes: 0 additions & 42 deletions docs-site/src/examples/open_by_default.jsx

This file was deleted.

5 changes: 4 additions & 1 deletion test/datepicker_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ describe("DatePicker", () => {
it("should update the preSelection state when a day is selected with mouse click", () => {
// Note: We need monthsShown=2 so that today can still be clicked when
// ArrowLeft selects the previous month. (On the 1st 2 days of the month.)
// On the last week of the month, when the next month includes the current
// week, we need monthsShown=1 to prevent today from appearing twice.
const dayOfMonth = utils.getDate(utils.now());
var data = getOnInputKeyDownStuff({
shouldCloseOnSelect: false,
monthsShown: 2
monthsShown: dayOfMonth < 15 ? 2 : 1
});

TestUtils.Simulate.keyDown(data.nodeInput, getKey("ArrowLeft"));
Expand Down

0 comments on commit 67f05e9

Please sign in to comment.