Skip to content

Fix date range filter updating on each keystroke - #69955

Open
anmolxlight wants to merge 3 commits into
apache:mainfrom
anmolxlight:fix-datepicker-auto-submit-on-keystroke
Open

Fix date range filter updating on each keystroke#69955
anmolxlight wants to merge 3 commits into
apache:mainfrom
anmolxlight:fix-datepicker-auto-submit-on-keystroke

Conversation

@anmolxlight

@anmolxlight anmolxlight commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fix the date range filter inputs calling onChange on every valid keystroke, which triggered URL search param updates and caused the editing state to be overwritten by the synced value from the parent. This made the date picker effectively unusable - typed values would appear to flash or get replaced with formatted values.

Fix: Remove the auto-submit from the input change handler. The editing state stays local until the user explicitly applies it via any of these paths:

  • Clicking a date in the calendar popover
  • Pressing Enter in any date/time input
  • Clicking the new Apply button
  • Closing the popover (clicking outside or pressing Escape)

closes: #69891


Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code (DeepSeek V4 Flash)

Generated-by: Claude Code (DeepSeek V4 Flash) following the guidelines


Important

🛠️ Maintainer triage note for @anmolxlight · by @potiuk · 2026-07-28 16:32 UTC

Some review feedback from pierrejeambrun is waiting on you:

  • There are 2 unresolved review threads on this PR from pierrejeambrun.

The ball is in your court — you've been assigned to this PR. Push a fix or reply in each thread explaining why the feedback does not apply, then mark them resolved and ping the reviewer (pierrejeambrun) for a final look.

See the Pull Request quality criteria for how to fix each item. There is no rush.

Note: your branch is 298 commits behind main — please rebase and push again to get up-to-date CI results.

Automated triage — may be imperfect; a maintainer takes the next look. We use this two-stage triage process so maintainers' limited time goes to the conversation with you.

The date range filter inputs were calling onChange on every valid
keystroke, which triggered URL search param updates and caused the
editing state to be overwritten by the synced value from the parent.
This made the date picker effectively unusable - typed values would
appear to flash or get replaced with formatted values.

Fix: Remove the auto-submit from the input change handler. The
editing state stays local until the user explicitly applies it
via any of these paths:
  - Clicking a date in the calendar popover
  - Pressing Enter in any date/time input
  - Clicking the new Apply button
  - Closing the popover (clicking outside / pressing Escape)

closes: apache#69891
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 16, 2026
@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 16, 2026
@bbovenzi bbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Jul 16, 2026

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

  1. Please provide a gif/video of the fix
  2. Could we add a regression test while we're at it?

Comment thread airflow-core/src/airflow/ui/src/hooks/useDateRangeFilter.ts Outdated
Comment thread airflow-core/src/airflow/ui/src/components/FilterBar/filters/DateRangeInputs.tsx Outdated
- Remove useCallback wrapper from applyDateRange (React compiler handles memoization)
- Remove onApply prop, handleKeyDown, onKeyDown, and Apply button from DateRangeInputs
- Popover onOpenChange already calls applyDateRange on close — button is redundant
- Remove onApply={applyDateRange} from DateRangeFilter.tsx
@potiuk

potiuk commented Jul 20, 2026

Copy link
Copy Markdown
Member

@anmolxlight This PR has a few issues that need to be addressed before it can be reviewed — please see our Pull Request quality criteria.

Issues found:

  • Pre-commit / static checks: Failing: CI image checks / Static checks. Run prek run --from-ref main --stage pre-commit locally to reproduce and fix.

What to do next:

  • Fix each issue listed above.
  • Make sure static checks pass locally (prek run --from-ref main --stage pre-commit).
  • Mark the PR as "Ready for review" when you're done.

There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

@anmolxlight

Copy link
Copy Markdown
Contributor Author

Fixed the ts-compile-lint-ui ordering issue and rebased onto latest main. Let's see what CI says.

@pierrejeambrun pierrejeambrun changed the title UI: Fix date range filter updating on each keystroke Fix date range filter updating on each keystroke Jul 23, 2026

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind providing a screenshot / screen recording to highlight the fix. "Before vs After".

This will help reviewing the PR and reproducing the issue locally thanks

onClear,
onDateBlur,
onFocus,
onKeyDown,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop seems like dead code, it's never passed.

Comment on lines +68 to +73
onOpenChange={(details) => {
if (!details.open) {
// Submit the current editing state when the popover closes
applyDateRange();
}
}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applyDateRange fires on every popover close. (Even when no edit has been done, a cheap check on the value could prevent this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datepicker seems to update on each keystroke making it unusable

5 participants