angular-material-extensions / select-country

Angular Material component that allow users to select a country or nationality with an autocomplete feature
https://angular-material-extensions.github.io/select-country/
MIT License
126 stars 41 forks source link

Autofill is not working #82

Open RHeynsZa opened 3 years ago

RHeynsZa commented 3 years ago

Describe the bug Value is not being set when auto set by browser, ie Chrome Autofill

To Reproduce Steps to reproduce the behavior:

  1. Have a country saved to auto fill
  2. try to fill a form with country select
  3. See it populate with your country, but not be set

Expected behavior Either the component needs to respect autofill, and select a country if only one is found after the autofill. Or autofill should be disabled.

Screenshots Result: image

Expected Result: image

Desktop (please complete the following information):

RHeynsZa commented 3 years ago

I see the ability to disable autocomplete has been merged for a while, but there hasn't been a release in 2 months. I will thus keep this open

sommercity commented 2 years ago

In case someone has the same issue, i was able to deactivate autofill on the country-field by adding autocomplete="new-country" to mat-country-select

<mat-select-country appearance="fill" label="Land" formControlName="country" autocomplete="new-country" [required]="true" (onCountrySelected)="onCountrySelected($event)"> </mat-select-country>

RDeluxe commented 1 year ago

This is not working for me, 1password is filling the field anyway

davidmarogy commented 1 month ago

Same for me, i can't dissable autocomplete. Alternative if it would be possible to set an error if no value is selected, everything would be fine for me.

      <mat-select-country i18n-label="@@addWarehouse.add_form.country" appearance="fill" label="Country"
                          [language]="locale"
                          [itemsLoadSize]="500"
                          [required] = true
                          [error]="'Mandatory field'"
                          autocomplete="new-country"
                          formControlName="country"
                          class="body-default"
      >
      </mat-select-country>