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

When opening the picker with togglePicker, start date is not selected #295

Open
tkrevh opened this issue Feb 21, 2022 · 3 comments
Open

Comments

@tkrevh
Copy link

tkrevh commented Feb 21, 2022

I have a case, where we need to open the picker programmatically using togglePicker when editing a scheduled post.
The picker opens, but it doesn't select the initial date and time.

If the picker is opened via users input, the initial date and time and selected.

Any ideas?

@tkrevh
Copy link
Author

tkrevh commented Feb 21, 2022

I was able to work around it by calling dateClick with the initial value after the toggle.

@tkrevh
Copy link
Author

tkrevh commented Feb 21, 2022

Ok,

after some code review and testing, I think I've found the issue.

We're using singleDatePicker and the isClear computed property is checking if both startDate and endDate are set.
Then the dateRange.startDate watcher does not set the this.start data property, because isClear is true.

For a fix, I suggest only checking in isClear computed property if endDate is set, if singleDatePicker=false

@tkrevh
Copy link
Author

tkrevh commented Feb 21, 2022

Submitted PR #296

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

No branches or pull requests

1 participant