-
Notifications
You must be signed in to change notification settings - Fork 140
Auto-focus search input when opening Add Filter menu #3145
Copy link
Copy link
Open
Description
Description
When clicking the Add Filter button in the workflow list filter bar, the dropdown menu opens but the search input inside it is not focused. Users have to click again on the input to start typing, which adds unnecessary friction.
Expected Behavior
When the "Add Filter" menu opens, the search input should be automatically focused so users can start typing a search attribute name immediately.
Affected Components
src/lib/components/workflow/filter-bar/search-attribute-menu.sveltesrc/lib/components/standalone-activities/activities-summary-filter-bar/search-attribute-menu.sveltesrc/lib/components/search-attribute-filter/search-attribute-menu.svelte
Suggested Fix
Use Svelte's tick() to wait for the DOM update after the menu opens, then focus the filter-search input. The MenuButton's onclick callback already receives the new open state as a boolean, so we can focus the input only when opening (not closing):
onclick={(isOpen) => {
searchAttributeValue = '';
if (isOpen) {
tick().then(() => document.getElementById('filter-search')?.focus());
}
}}I have a working implementation ready and would be happy to submit a PR if this is accepted.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels