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

Buefy multiple datepicker jumps unnaturally to the latest value in the value array #3333

Closed
mustafasezer opened this issue May 14, 2021 · 3 comments · Fixed by #3341
Closed

Comments

@mustafasezer
Copy link

mustafasezer commented May 14, 2021

Overview of the problem

Buefy version: [0.9.2]
Vuejs version: [2.6.11]
OS/Browser: Ubuntu 20.04, Chrome 90.0.4430.93

Description

The datepicker focuses in multiple selection mode to the latest value in the array. This causes unnatural jumps when values are changed. If you have multiple dates selected which are alternating between months, each time you change the latest value, you jump around the calendar. This makes it impossible to remove multiple dates next to each other, if the values in array are distributed.

Steps to reproduce

For example

  1. Select May 15, 2021.
  2. Select June 15, 2021.
  3. Select May 17, 2021.
  4. Select June 17, 2021.
  5. Select May 19, 2021.
  6. Select June 19, 2021.
  7. Now we want to remove all selected dates in June.
  8. Remove June 19. -> calendar jumps to May. You have to change month manually to June.
  9. Remove June 17. -> calendar jumps to May. You have to change month manually to June.
  10. Remove June 15. -> calendar jumps to May. You have to change month manually to June.

Expected behavior

Do not change focusedDate (which I guess controls the current month view) unless the user wants to do so (e.g. by a boolean variable to auto-jump to latest/earliest/last date)

Actual behavior

Datepicker jumps to a different month each time you remove a date from the end of the array.

@jtommy
Copy link
Member

jtommy commented May 16, 2021

You are right! Probably better maintain the current month

@mateusbw
Copy link
Contributor

mateusbw commented May 21, 2021

@mustafasezer do you want to work on it? If not, I would like to have a go on this one.

@mustafasezer
Copy link
Author

@mateusbw Feel free to go for it ;) I am not familliar with the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants