File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
frontend/src/lib/components/route-form Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 88 import { useI18n } from " ../../utils/i18n" ;
99
1010 const context = injectContextRequired ();
11+ const mapContext = toRef (() => context .components .map );
1112 const searchBoxContext = requireSearchBoxContext (context );
1213 const i18n = useI18n ();
1314
3435 function activate(): void {
3536 searchBoxContext .value .activateTab (` fm${context .id }-route-form-tab ` , { expand: true });
3637 }
38+
39+ function handleHashQueryChange(query : HashQuery | undefined ) {
40+ hashQuery .value = query ;
41+
42+ if (query ) {
43+ mapContext .value ?.components .selectionHandler .setSelectedItems ([]); // Workaround for now to force route into the hash query
44+ }
45+ }
3746 </script >
3847
3948<template >
4453 class =" fm-route-form-tab"
4554 >
4655 <template #default =" slotProps " >
47- <RouteForm :active =" slotProps.isActive" @activate =" activate()" ref =" routeForm" @hash-query-change =" hashQuery = $event" ></RouteForm >
56+ <RouteForm :active =" slotProps.isActive" @activate =" activate()" ref =" routeForm" @hash-query-change =" handleHashQueryChange( $event) " ></RouteForm >
4857 </template >
4958 </SearchBoxTab >
5059</template >
Original file line number Diff line number Diff line change 420420 reset ();
421421
422422 try {
423- mapContext .value .components .selectionHandler .setSelectedItems ([]); // Workaround for now to force route into the hash query
424-
425423 const mode = routeMode .value ;
426424
427425 submittedQuery .value = { destinations: cloneDeep (toRaw (destinations .value )), mode };
451449
452450 async function reroute(zoom : boolean , smooth = true ): Promise <void > {
453451 if (hasRoute .value ) {
454- mapContext .value .components .selectionHandler .setSelectedItems ([]); // Workaround for now to force route into the hash query
455-
456452 await Promise .all (destinations .value .map ((dest ) => loadSuggestions (dest )));
457453 const points = destinations .value .map ((dest ) => getSelectedSuggestion (dest ));
458454
You can’t perform that action at this time.
0 commit comments