Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onChange callback doesn`t trigger when i try to select range in year view (range from start month to end month) #971

Open
2 tasks done
Eugene1803 opened this issue Feb 12, 2025 · 0 comments
Labels
question Further information is requested

Comments

@Eugene1803
Copy link

Before you start - checklist

  • I followed instructions in documentation written for my React-Calendar version
  • I have checked if this bug is not already reported

Description

Hi!
I am using react-calendar v 3.1.0 and when i try to select range from month to month (using year view and allowPartialRange prop), onChange callback doesn`t trigger and range cannot be selected
Also, when i tried to pass array ["from date" , "to date"] as a value (using year view and selectRange=true prop), calendar didn't show selected range, only one selected month (for some reason the month which is the end of range, that was passed in value prop

Image

).

Steps to reproduce

  1. react-calendar v3.1.0
  2. props
    view='year' showDoubleView={true} selectRange={true} value={[from, to]} allowPartialRange={true} onChange={this.onRangeChange}

onRangeChange = range => this.setState({from: range[0], to: range[1]});

Expected behavior

onChange callback triggers, then i put dates from this callback to state, then i pass these dates as value to react-calendar and then i can see selected range

Actual behavior

onChange callback never triggers and i cannot see selected range

Additional information

No response

Environment

  • Browser (if applicable):
  • React-Calendar version:
  • React version:
@Eugene1803 Eugene1803 added the bug Something isn't working label Feb 12, 2025
@wojtekmaj wojtekmaj added question Further information is requested and removed bug Something isn't working labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants