The filter panel component has two independent defects: one breaks the freshness of the displayed data when the query changes quickly, and the other prevents the panel from being safely closed via the keyboard.
Vue 3.5 Composition API and TypeScript 5.8 are used in the browser.query: string — the current search text;open: boolean — whether the panel is shown;items: { id: string; label: string }[] — the source list.visibleItems as the list of elements whose label contains query case-insensitively.query is empty or consists only of spaces, the list must be empty.query changes, asynchronous suggestion loading is triggered via fetchSuggestions(query).query, it must not overwrite the state of a newer request.open = true, Escape closes the panel via emit('close').open = true and query = "al".query to "alex" before the first response completes.Escape, then unmount the component and press Escape on the page again.query.Escape should close only the open panel.npm test and manual verification in the browserfetchSuggestions is provided by the parent layer and returns Promise<{ items: { id: string; label: string }[] }>Use line comments to explain the problem, its impact, the fix and how to test it.