Typing the end hour in the event composer resets it to 13:30

AI-generated summary

dmorlock reports a bug in Discourse Events v0.5.0 (Chrome) where typing an end hour in the event composer resets to the previous value or start time + 1 hour. For example, with a start of 12:30 and end of 13:30, typing 16 or 14 results in the end time reverting to 13:30, whereas using arrow keys works correctly. The user hypothesizes that the adjustedRangeEnd handler, which enforces an end time at least one hour after the start, is incorrectly triggering after a single digit is typed rather than waiting for the full input to be completed.

I’m using Chrome with Discourse Events v0.5.0. In the event composer, I set the start time to 12:30 and the end time to 13:30 on the same day.

  1. Click the hour part of the end time and type 16. The field still shows 13:30.
  2. Use the up arrow to change it to 18:30. That works.
  3. Click the hour again and type 14. I expect 14:30, but it jumps back to 13:30.

The end-time change handler calls adjustedRangeEnd, which resets an end time at or before the start to one hour after the start. Could that check be running after the first digit, before I’ve finished typing the hour?

1 Like