@fluid-topics/ft-search-input 2.0.32 → 2.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ export declare class FtSearchInput extends FtSearchInput_base implements FtSearc
29
29
  private onSearchBarKeyUp;
30
30
  private onInput;
31
31
  private onClearInput;
32
- private launchSearch;
32
+ launchSearch(query: string): void;
33
33
  onSuggestionSelected(value: string): void;
34
34
  get shouldDisplaySuggestions(): boolean;
35
35
  private onClick;
@@ -142,8 +142,19 @@ export class FtSearchInput extends withI18n(FtSearchComponent) {
142
142
  }
143
143
  break;
144
144
  case "Enter": {
145
- const elementToClick = this.suggestions.selectedSuggestOption || this.launchSearchButton;
146
- elementToClick === null || elementToClick === void 0 ? void 0 : elementToClick.click();
145
+ // Select suggested option if applicable
146
+ const elementToClick = this.suggestions.selectedSuggestOption;
147
+ if (elementToClick) {
148
+ elementToClick.click();
149
+ break; // Clicking the selected suggestion will already launch a search
150
+ }
151
+ // Launch search
152
+ if (this.useCustomSearchPath) {
153
+ this.launchSearchButton.click();
154
+ }
155
+ else {
156
+ this.launchSearch(this.liveQuery);
157
+ }
147
158
  break;
148
159
  }
149
160
  case "Backspace":
@@ -156,14 +167,6 @@ export class FtSearchInput extends withI18n(FtSearchComponent) {
156
167
  case "Backspace":
157
168
  e.stopPropagation();
158
169
  break;
159
- case "Enter":
160
- if (this.useCustomSearchPath) {
161
- this.launchSearchButton.click();
162
- }
163
- else {
164
- this.launchSearch(this.liveQuery);
165
- }
166
- break;
167
170
  default:
168
171
  break;
169
172
  }
@@ -273,6 +276,9 @@ __decorate([
273
276
  __decorate([
274
277
  query(`[part="launch-search-in-input"]`)
275
278
  ], FtSearchInput.prototype, "launchSearchButton", void 0);
279
+ __decorate([
280
+ ignoreComposingEvents()
281
+ ], FtSearchInput.prototype, "onSearchBarKeyDown", null);
276
282
  __decorate([
277
283
  ignoreComposingEvents()
278
284
  ], FtSearchInput.prototype, "onSearchBarKeyUp", null);