Skip to content

Prevent Day Picker from changing months. #1105

Answered by brojd
bilbobag asked this question in Support
Discussion options

You must be logged in to vote

Hey @bilbobag , thanks, I've also figured out solution based on using ref, something like:

const onDayChange = useCallback(() => {
    inputRef.current.setState({ month: from });
  }, [from]);

return <DayPickerInput
            dayPickerProps={dayPickerProps}
            hideOnDayClick={false}
            ref={inputRef}
            component={component}
            onDayChange={onDayChange}
          />

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@gpbl
Comment options

Answer selected by gpbl
Comment options

You must be logged in to vote
4 replies
@matbagilcz
Comment options

@ivanyufen
Comment options

@gpbl
Comment options

@ivanyufen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #1047 on February 10, 2021 02:16.