Skip to content

Commit

Permalink
Text and URI in search control callback (#21)
Browse files Browse the repository at this point in the history
<!--

Thank you for submitting a pull request!

Here's a checklist you might find useful.
[ ] There is an associated issue that is labelled
  'Bug' or 'help wanted' or is in the Community milestone
[ ] Code is up-to-date with the `main` branch
[ ] You've successfully run `npm test` locally
[ ] There are new or updated tests validating the change

-->

Fixes #
  • Loading branch information
matthew44-mappable committed Jun 21, 2024
1 parent 6550d35 commit 0f629ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controls/MMapSearchControl/MMapSuggest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class MMapSuggest extends mappable.MMapComplexEntity<MMapSuggestProps> {

private _addSuggestItems(suggest: SuggestResponse, onSuggestClick: MMapSuggestProps['onSuggestClick']) {
suggest.forEach((suggestItem) => {
const searchParams = suggestItem.uri ? {uri: suggestItem.uri} : {text: suggestItem.title.text};
const searchParams = {uri: suggestItem.uri, text: suggestItem.title.text};

this.addChild(
new MMapSuggestItem({
Expand Down
2 changes: 1 addition & 1 deletion src/controls/MMapSearchControl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class MMapSearchCommonControl extends mappable.MMapComplexEntity<MMapSearchContr
event.preventDefault();

const activeSuggestUri = (this.children[0] as MMapSuggest)?.activeSuggest?.dataset?.uri;
const searchParams = activeSuggestUri ? {uri: activeSuggestUri} : {text: this._searchInput.value};
const searchParams = {uri: activeSuggestUri, text: this._searchInput.value};

this._search(searchParams);
this._resetInput();
Expand Down

0 comments on commit 0f629ab

Please sign in to comment.