Merge "Replace `GerritNav.navigateToChange()` by new `setUrl()` service"
diff --git a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
index ee6948a..17edc19 100644
--- a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
+++ b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
@@ -21,7 +21,6 @@
query as queryDec,
} from 'lit/decorators.js';
import {Shortcut, ShortcutController} from '../../lit/shortcut-controller';
-import {query as queryUtil} from '../../../utils/common-util';
import {assertIsDefined} from '../../../utils/common-util';
import {configModelToken} from '../../../models/config/config-model';
import {resolve} from '../../../models/dependency';
@@ -295,14 +294,6 @@
*/
private preventDefaultAndNavigateToInputVal(e: Event) {
e.preventDefault();
- const target = e.composedPath()[0] as HTMLElement;
- // If the target is the #searchInput or has a sub-input component, that
- // is what holds the focus as opposed to the target from the DOM event.
- if (queryUtil(target, '#input')) {
- queryUtil<HTMLElement>(target, '#input')!.blur();
- } else {
- target.blur();
- }
if (!this.inputVal) return;
const trimmedInput = this.inputVal.trim();
if (trimmedInput) {
diff --git a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
index f7e8b8e..dbb3db9 100644
--- a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
+++ b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
@@ -134,26 +134,6 @@
await promise;
});
- test('input blurred after commit', async () => {
- const blurSpy = sinon.spy(
- queryAndAssert<PaperInputElement>(
- queryAndAssert<GrAutocomplete>(element, '#searchInput'),
- '#input'
- ),
- 'blur'
- );
- queryAndAssert<GrAutocomplete>(element, '#searchInput').text = 'fate/stay';
- await element.updateComplete;
- pressKey(
- queryAndAssert<PaperInputElement>(
- queryAndAssert<GrAutocomplete>(element, '#searchInput'),
- '#input'
- ),
- Key.ENTER
- );
- await waitUntil(() => blurSpy.called);
- });
-
test('empty search query does not trigger nav', async () => {
const searchSpy = sinon.spy();
element.addEventListener('handle-search', searchSpy);