fix(sidebar): restore search input focus after clearing the sidebar search

This commit is contained in:
2026-04-12 10:23:02 +00:00
parent 3499652622
commit a7f5341baa
3 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## 2026-04-12 - 3.8.2 - fix(sidebar)
restore search input focus after clearing the sidebar search
- Updates the sidebar clearSearch behavior to focus the .search-input element after resetting the query and dispatching searchChanged.
- Improves search usability by letting users continue typing immediately after clearing the current search.
## 2026-04-12 - 3.8.1 - fix(build)
migrate smart config and update build tooling for latest tsbundle and TypeScript defaults

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-wcctools',
version: '3.8.1',
version: '3.8.2',
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
}

View File

@@ -867,6 +867,8 @@ export class WccSidebar extends DeesElement {
private clearSearch() {
this.searchQuery = '';
this.dispatchEvent(new CustomEvent('searchChanged', { detail: this.searchQuery }));
const input = this.shadowRoot.querySelector('.search-input') as HTMLInputElement;
if (input) input.focus();
}
private handleMenuScroll(e: Event) {