Skip to content

Commit

Permalink
Merge pull request #4996 from Zulaxy/main
Browse files Browse the repository at this point in the history
The classname "react-datepicker-ignore-onclickoutside" is not applied to custom input
  • Loading branch information
martijnrusschen authored Jul 20, 2024
2 parents 84c072f + 0557c3c commit 5c287e4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs-site/src/examples/customInput.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
() => {
const [startDate, setStartDate] = useState(new Date());
const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
<button className="example-custom-input" onClick={onClick} ref={ref}>
{value}
</button>
));
const ExampleCustomInput = forwardRef(
({ value, onClick, className }, ref) => (
<button className={className} onClick={onClick} ref={ref}>
{value}
</button>
),
);
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
customInput={<ExampleCustomInput />}
customInput={<ExampleCustomInput className="example-custom-input" />}
/>
);
};

0 comments on commit 5c287e4

Please sign in to comment.