Open Bug 1866244 Opened 2 years ago Updated 2 months ago

Date picker onchange event fired constantly when navigating

Categories

(Core :: DOM: Forms, enhancement)

Firefox 143
enhancement

Tracking

()

People

(Reporter: askele.johansson, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

Steps to reproduce:

  1. Open Firefox
  2. Open this fiddle https://jsfiddle.net/96deroca/3/
  3. Open the date picker.
  4. Click on the month and year drop down.
  5. Select a different month or a year.
  6. observe the console output when doing step 5.

Actual results:

The onchange event is fired whenever a year or month is selected from the drop down. The user has not picked a date explicitly at this point yet, but is rather still navigating.

Expected results:

The onchange event was expected to be fired only after the specific date was selected, and not while navigating months or years from the drop down. The expected behaviour is achieved in Chrome browsers.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Similarly, when actually selecting a month or year that is not adjacent to the currently selected, the picker selects each option in between before selecting the correct date. This in turn triggers change events multiple times when a user intends to only make one date change.

Reproduce:

  1. 01/25/2024 is selected
    2, User opens the picker
  2. Navigates to the month/year drop down
  3. Selects November, March, 2022, or 2026 (any non-adjacent)
  4. Change event is triggered twice, once for the adjacent option and once for the selected option.

Still happens on Nightly.

Blocks: datetime
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 1.8 Branch → Firefox 143
Component: DOM: Core & HTML → DOM: Forms
You need to log in before you can comment on or make changes to this bug.