From 9344cb7dfcb33569ccac58686b11a476965417fd Mon Sep 17 00:00:00 2001 From: AleksanderBodurri Date: Mon, 10 May 2021 18:24:35 -0400 Subject: [PATCH] feat(devtools): focus search input when icon is clicked Previously, clicking the search icon on the component explorer did nothing. Now it focuses search input on click. --- cypress/integration/node-search.e2e.js | 5 ++ .../filter/filter.component.html | 25 ++++---- .../filter/filter.component.scss | 64 ++++++++++--------- 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/cypress/integration/node-search.e2e.js b/cypress/integration/node-search.e2e.js index c92b291994a..effd6d7a335 100644 --- a/cypress/integration/node-search.e2e.js +++ b/cypress/integration/node-search.e2e.js @@ -88,4 +88,9 @@ describe('Search items in component tree', () => { // should show correct component properties cy.get('ng-property-view').find('mat-tree-node'); }); + + it('should focus search input when search icon is clicked', () => { + cy.get('.filter label .search-icon').click({ force: true }); + cy.get('.filter label input').should('have.focus'); + }); }); diff --git a/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/filter/filter.component.html b/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/filter/filter.component.html index 330d47f48b2..8f71cf1d606 100644 --- a/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/filter/filter.component.html +++ b/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/filter/filter.component.html @@ -1,16 +1,17 @@ -
- search -
- +