Skip to content

Commit

Permalink
Fix suggest when resetting input in route-control
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew44-mappable committed Aug 12, 2024
1 parent 975509a commit 9206297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/controls/MMapRouteControl/MMapWaypointInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export type MMapWaypointInputProps = {

const defaultProps = Object.freeze({geolocationTextInput: 'My location'});

/**
* @internal
*/
export class MMapWaypointInput extends mappable.MMapComplexEntity<MMapWaypointInputProps, typeof defaultProps> {
static defaultProps = defaultProps;
private _detachDom?: DomDetach;
Expand Down Expand Up @@ -194,6 +197,7 @@ export class MMapWaypointInput extends mappable.MMapComplexEntity<MMapWaypointIn

private _resetInput() {
this._inputEl.value = '';
this._suggestComponent.update({searchInputValue: ''});
this._updateIndicatorStatus('empty');
this._props.onSelectWaypoint(null);
}
Expand Down
4 changes: 2 additions & 2 deletions src/controls/MMapSearchControl/MMapSuggest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class MMapSuggest extends mappable.MMapComplexEntity<MMapSuggestProps> {
}

private _updateSuggest(props: Partial<MMapSuggestProps>) {
if (props.searchInputValue) {
if (props.searchInputValue !== undefined) {
this._updateSuggestList(props.searchInputValue);
}

if (props.suggestNavigationAction) {
if (props.suggestNavigationAction !== undefined) {
this._updateActiveSuggest(props.suggestNavigationAction);
}
}
Expand Down

0 comments on commit 9206297

Please sign in to comment.