@bpost/bp-address-auto-complete-by-component 1.1.28 → 1.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2768,6 +2768,9 @@ class StreetNumberComponent {
2768
2768
  }
2769
2769
  onFocus() {
2770
2770
  this.collapseDropdown = false;
2771
+ if (this.prefillData !== null && this.prefillData.prefillStreetNumberPerfectMatchFound != false) {
2772
+ this.collapseDropdown = true;
2773
+ }
2771
2774
  // this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
2772
2775
  // ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
2773
2776
  // this.prefilling = false;
@@ -2964,7 +2967,7 @@ class StreetNumberComponent {
2964
2967
  this.buildInputWordList();
2965
2968
  }
2966
2969
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
2967
- ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
2970
+ ? this.prefillData.prefillStreetNumberPerfectMatchFound : false;
2968
2971
  }
2969
2972
  handleGetStreetError(source) {
2970
2973
  if (this.allowNoValidation && this.validatedByBackend) {
@@ -3313,9 +3316,12 @@ class StreetNumberComponent {
3313
3316
  if (suggestion) {
3314
3317
  this.clearTypeAhead();
3315
3318
  this.resetArrowSelectedIndex();
3316
- if (suggestion.string) {
3319
+ if (suggestion.searchBarString) {
3317
3320
  this.setSearchText(suggestion.searchBarString);
3318
3321
  }
3322
+ else if (suggestion.string) {
3323
+ this.setSearchText(suggestion.string);
3324
+ }
3319
3325
  this.collapseDropdown = true;
3320
3326
  const notInList = suggestion['not-in-list'];
3321
3327
  const isNotInList = notInList !== null && notInList !== undefined && notInList === true;
@@ -3863,6 +3869,9 @@ class BoxNumberComponent {
3863
3869
  }
3864
3870
  onFocus() {
3865
3871
  this.collapseDropdown = false;
3872
+ if (this.prefillData !== null && this.prefillData.prefillBoxNumberPerfectMatchFound != false) {
3873
+ this.collapseDropdown = true;
3874
+ }
3866
3875
  // this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
3867
3876
  // ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
3868
3877
  // this.prefilling = false;
@@ -4349,9 +4358,12 @@ class BoxNumberComponent {
4349
4358
  if (suggestion) {
4350
4359
  this.clearTypeAhead();
4351
4360
  this.resetArrowSelectedIndex();
4352
- if (suggestion.string) {
4361
+ if (suggestion.searchBarString) {
4353
4362
  this.setSearchText(suggestion.searchBarString);
4354
4363
  }
4364
+ else if (suggestion.string) {
4365
+ this.setSearchText(suggestion.string);
4366
+ }
4355
4367
  this.collapseDropdown = true;
4356
4368
  // if (suggestion.hasOwnProperty('isComplete')) {
4357
4369
  // this.showAddressIsValidated();