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

[pickers] onMonthChange doesn't call after click to days outside the current month #6953

Open
2 tasks done
Semigradsky opened this issue Nov 22, 2022 · 5 comments · May be fixed by #6954
Open
2 tasks done

[pickers] onMonthChange doesn't call after click to days outside the current month #6953

Semigradsky opened this issue Nov 22, 2022 · 5 comments · May be fixed by #6954
Assignees
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module!

Comments

@Semigradsky
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/zen-hodgkin-8ijm8m?file=/demo.tsx

Steps:

  1. Add showDaysOutsideCurrentMonth
  2. Click to day outside current month
  3. Only onChange callback was called. onMonthChange wasn't called.

Current behavior 😯

onMonthChange wasn't called.

Expected behavior 🤔

onMonthChange called.

Context 🔦

By documentation:

onMonthChange - Callback firing on month change

Your environment 🌎

No response

Order ID 💳 (optional)

No response

@Semigradsky Semigradsky added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 22, 2022
@flaviendelangle
Copy link
Member

flaviendelangle commented Nov 22, 2022

Hi,

Indeed, onMonthChange is only fired when you change the value from the outside of the picker or if you change it from the month view.

That's not very coherent, I'll look on how to improve it 👍

@flaviendelangle flaviendelangle added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 22, 2022
@flaviendelangle flaviendelangle self-assigned this Nov 22, 2022
@dhulme
Copy link
Contributor

dhulme commented Feb 10, 2023

I have a similar issue that the onMonthChange doesn't fire when using the keyboard to navigate between months. Not sure if your PR would coever than too @flaviendelangle?

@flaviendelangle
Copy link
Member

This PR was not merged yet because we are unclear about what the callback should designate (should it be fired when the month of the value changes or when the month visible on screen changes).

If it's the 2nd one, then sure the PR will cover your use case.

If it's the 1st one, we will probably add a new callback for the visible month on screen.

@dhulme
Copy link
Contributor

dhulme commented Feb 10, 2023

Ok thank you. Perhaps keeping the current callback for the value, and adding a new onVisibleMonthChange or similar could be a solution?

@flaviendelangle
Copy link
Member

That's one of the approach we can take indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants