home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.02k stars 2.75k forks source link

Calendar add/edit event dialogs not saving via keyboard, only mouse #21568

Open SeanPM5 opened 2 months ago

SeanPM5 commented 2 months ago

Checklist

Describe the issue you are experiencing

When trying to reproduce #21567 noticed an issue with saving the calendar event dialogs via mouse

Add event dialog

When entering an event name (summary field) and then trying to save using the keyboard (enter/return key) it will display an incorrect error that "Not all required fields are filled in" . With the same data filled in it'll save when clicking the "Add Event" button in the bottom of the dialog.

https://github.com/user-attachments/assets/a86e4579-1747-4a40-97bd-53a19ea4e6d1

Edit event dialog

Similar to above, except without the error. When editing an existing event, if you try to save your changes via the keyboard (enter/return key) it will just silently discard your changes. If you save by clicking the "Save Event" button with your mouse, it will save properly.

https://github.com/user-attachments/assets/3b2a6d14-ff12-4712-913b-737e814fe649

Describe the behavior you expected

Allow saving these dialogs via keyboard

Steps to reproduce the issue

Open your Home Assistant instance and show your calendar.

  1. Navigate to Calendars panel
  2. Add a new event via keyboard, won't work and throws error. Clicking the button with mouse (with same exact data) will save.
  3. Edit an existing event via keyboard, rename the summary, try saving via keyboard, won't work. Do same with mouse and it works.

What version of Home Assistant Core has the issue?

2024.7.4

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

ThanushKrishna commented 2 months ago

I would like to work on this Bug, Please assign to me.

silamon commented 2 months ago

@ThanushKrishna , you can work on this without being assigned. When you've found a solution for this problem, create a pull request to get your fix merged into Home Assistant.

The code for the dialog can be found here: https://github.com/home-assistant/frontend/blob/dev/src/panels/calendar/dialog-calendar-event-detail.ts

ThanushKrishna commented 2 months ago

Thanks @silamon I have setup the development environment, but I am not able to see the Events in the calendar panel image Please let me know if I am doing anything wrong, just to let you know I'm using the dev branch.

silamon commented 2 months ago

There's a button "Create calendar" at the bottom. That will setup a new calendar where you can add events to. The 2 calendars from the "demo" integration are read-only.