Skip to content

Bug: Passing onChange to Custom Dropdown component #1832

Answered by gpbl
nickcanarelli asked this question in Support
Discussion options

You must be logged in to vote

@nickcanarelli when implementing a custom navigation, you have two options:

  1. replace the Dropdown via the components prop and add the proper casting to work with an HTML select with HTML option elements. I understand this is more complex than thought, hopefully will be fixed in next release.
  2. replace the Caption via the components and implement your own navigation – without the limits of the Dropdown: https://react-day-picker.js.org/guides/custom-components#custom-caption. This is the preferred method when working with custom HTML dropdown.

Your Dropwdown.tsx there has no type annotations, so you can't see where are the issues:

  • use DropdownProps type to make sure your custom Dropdown get…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gpbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1831 on July 11, 2023 12:32.