frontend
frontend copied to clipboard
input_datetime picker - unable to set date when clicking the calendar icon
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
When using an input_datetime entity (with both time and date) in an entites card, I am unable to select a date if I click on the little calendar icon besides the date most of the time (sometimes it works on the first click, but not the next ones). If I click on the date itself, the picker works.
Describe the behavior you expected
I should be able to select a date whether I click on the date itself or on the calendar icon in the picker.
Steps to reproduce the issue
- Add an input_datetime with both has_date and has_time set to true on config.yaml
- Restart HA
- Create an entities card on a dashboard, add the input_datetime entity, save the card
- Click on the calendar icon on the right side of the date and try to select a date - it won´t get selected
- If it works on the first try, try again ...
What version of Home Assistant Core has the issue?
2022.7.6
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Google Chrome 103.0.5060.134 / Mozilla Firefox 102.0.1
Which operating system are you using to run this browser?
Kubuntu 22.04 / Windows 7
State of relevant entities
No response
Problem-relevant frontend configuration
type: entities
entities:
- entity: input_datetime.allowed_from
Javascript errors shown in your browser console/inspector
No response
Additional information
I can reproduce this on Chrome and Firefox on Linux, as well as Chrome on Windows 7 (did not test Firefox on Windows).
I will add that, on mobile, it is very difficult to edit the times in the time picker. When you tap the e.g. time field, the cursor is placed in the middle and you can delete the preceding digit, but not the next one. Then. Typing one digit automatically accepts the input including the digit which remained from the previous.
A reasonable behaviour would be if both the digits are selected in tapping into the field, delete removes both of them and you can type a new time from scratch.
I was in the process to report the same issue and I found it has already been reported, it is a very annoying behavior, especially when using the dashboard on a mobile device.
I can report a more or less same issue but in my case I am using a helper entity of type datetime and it is set for date only. When I set up an entity field on a dashboard to display the helper and then I attempt to edit the content, there are two different responses based on the two different browsers I have tested. In Firefox, the first try at changing the date works fine. The second time I try to change the date while in the same browser window, the date change will fail. If I refresh the browser, a new attempt at changing the date will succeed ... only once. In chrome, the situation is slightly different. When I click on the field in order to change the date, I get an intermediate window (same in both browsers). If I click on the calendar icon I get the date picker and I can change the date but, if I do not close the intermediate window and try to pick another day in the calendar picker, the date is not changed. I can however change the date in the intermediate field by editing the date which then gives my the calendar picker which now works again. It is real funky .... in Chrome, closing the intermediate window and then opening it up again for another date change will succeed. In firefox, changing the text date in the intermediate window will then allow the calendar picker to work once. Unlike in Chrome, closing the intermediate window and then re-open it will not allow you to pick another date. Refreshing the browser window will allow you to do a single date change again. In either browser, multiple date changes can be made in the calendar picker before 'ok' is selected. This is expected behaviour.
I have noticed similar behaviour (the date picker of input_datetime not working if the calendar icon is used to open the picker). My config is latest HA and the input_datetime is date only. If you click on the date itself the picker works. This has been the same on Edge, Chrome (Windows) and iOS through all versions since I've used it (1 year). The "today" button in the date picker is the only thing that works when you've loaded the date picker by clicking the calendar icon.
A related thread which may be caused by the same issue. #13582
Can anyone point me to the code for the frontend of the calendar date picker? The only input_datetime code I can find seems to be for the back end.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This seems to ahve been fixed as of 2022.12.7.
Awesome! I confirm it is fixed in 2022.12.7. My thanks to whoever fixed it!
Thanks for the confirmations.