Fix keyboard navigation for date token in filtered search
What does this MR do and why?
Fixes keyboard navigation issues with the date filter token in the filtered search bar, as described in #420266.
- Handle
Tabkey to submit the selected date before the token deactivates (previously pressing Tab would make the token disappear without saving) - Fix
Backspaceclearing the date input causing the date to reappear (previously clearing the date with backspace would cause it to magically reappear) - Add unit tests for both keyboard navigation behaviors
How to set up and validate locally
-
Enable the feature flag in Rails console:
Copy to clipboard
Copy to clipboard
Insert at cursor
Insert at cursor
Feature.enable(:issue_date_filter) -
Visit any issues list page e.g.
http://127.0.0.1:3000/dashboard/issues -
Click the search/filter bar and select Created date
-
Select on or after operator
-
Pick a date using the mouse
-
Press Tab — the token should stay and submit the date
-
Add another date token, pick a date, press Backspace to clear — the date should stay cleared
References