We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0fc1a7 commit 621b442Copy full SHA for 621b442
elements/pf-search-input/pf-search-input.ts
@@ -191,6 +191,7 @@ export class PfSearchInput extends LitElement {
191
accessible-label="search"
192
id="toggle-input"
193
?disabled="${disabled}"
194
+ @keydown=${this.#onSearchInput}
195
placeholder="${placeholder || this.#buttonLabel}">
196
</pf-text-input>
197
<pf-button
@@ -312,6 +313,14 @@ export class PfSearchInput extends LitElement {
312
313
}
314
return false;
315
316
+
317
+ #onSearchInput(event: KeyboardEvent) {
318
+ if (event.key === 'Enter' || event.key === ' ') {
319
+ this.value = this._toggleInput?.value;
320
+ this.#internals.setFormValue(this.value ?? '');
321
+ this.dispatchEvent(new PfSearchChangeEvent());
322
+ }
323
324
325
326
declare global {
0 commit comments