coreui / coreui-pro

Other
8 stars 10 forks source link

date-picker / date-range-picker event fixes #550

Closed vladrusu closed 1 week ago

vladrusu commented 1 month ago

Hi again,

I'm coming with another pull request, this time fixing the date picker components (Date Picker and its parent, Date Range Picker).

More specifically, there are two bugs in the current copoment:

  1. dateChange.coreui.date-picker never triggers due to a typo in the calendar selector (.calendar instead of .calendars)
  2. Again, the dateChange is not triggered when updating the date component via input, only when selecting the date with the mouse. This also affects Date Range Picker, because an EVENT_INPUT does NOT trigger an EVENT_START_DATE_CHANGE (_startInput) or an EVENT_END_DATE_CHANGE (_endInput)

I fixed both bugs. I also rearchitectured a bit the Date Picker to listen to the EVENT_START_DATE_CHANGE triggered on the Date Range Picker it extends from and not the one from the Calendar, in order to capture also input events, as I said earlier.

Regards, Vlad