Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locationSelect does not return value #17

Open
QuintenGeoSolutions opened this issue Mar 3, 2020 · 3 comments
Open

locationSelect does not return value #17

QuintenGeoSolutions opened this issue Mar 3, 2020 · 3 comments

Comments

@QuintenGeoSolutions
Copy link

Issue:
when using the locationPickerWidget, upon selecting an address, the bar does not get the selected value and the event locationSelect does not fire.

Expected:
the event locationSelect fires when n address is selected from the dropdown, or when an address is found after pressing enter.

using:

  • Angular 8
  • location-picker without map
@Florian-Ramakers
Copy link
Collaborator

hmmm that's not supposed to happen. I'll take a look and let you know when it's fixed!

@Florian-Ramakers Florian-Ramakers self-assigned this Mar 4, 2020
@Florian-Ramakers
Copy link
Collaborator

I did a little research and the locationSelect event should be firing when showMap is set to false.
The locationSelect event emits the value of the current selected value (by clicking or pressing enter when results where found)

(locationSelect)="myOnChangeFunction($event)" => $event contains the selected value.

Can you verify if it works when using an ngModel or a reactiveFormControl? Note: you can only use one of the provided options at a time for getting a value.

@Florian-Ramakers Florian-Ramakers removed their assignment Mar 4, 2020
@minan61
Copy link

minan61 commented Apr 16, 2020

Hi Florian
The issue is that we use changeDetection: ChangeDetectionStrategy.OnPush as strategy for angular. This prevents the onclick event in the locationpicker dropdown to be fired. Pressing enter works as designed but click doesn;t work with this strategy

import { ChangeDetectionStrategy} from '@angular/core';

@component({
selector: 'app-toolbar',
templateUrl: './toolbar.component.html',
styleUrls: ['./toolbar.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})

Can you reproduce this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants