diff --git a/package.json b/package.json index bdf54b2d2..2c7200823 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gsa-sam/sam-ui-elements", - "version": "1.0.16", + "version": "1.0.17", "description": "SAM UI library", "repository": { "type": "git", diff --git a/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.html b/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.html index 6a1ae9437..9010bcc11 100755 --- a/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.html +++ b/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.html @@ -1,75 +1,36 @@ -
+
-
- + + " autocomplete="off" />
-
    +
      -
    • - + }" *ngFor="let result of results; let i = index" + (click)="!configuration.isSelectableGroup ? '' : selectItem(result)"> + -
      -
      +
      + }"> {{ getObjectValue(result, configuration.primaryTextField) }}
      - + ">
      {{ result[configuration.secondaryTextField] }}
      -
        -
      • +
      • -
        +
        -
        +
        + }"> {{ getObjectValue(child, configuration.primaryTextField) }}
        -
        + "> {{ child[configuration.secondaryTextField] }}
        -
          -
        • +
        • + " (click)="selectItem(subchild)">
          -
          + }"> {{ getObjectValue( subchild, @@ -192,12 +120,10 @@ ) }} -
          + "> {{ subchild[configuration.secondaryTextField] }}
          @@ -225,39 +151,16 @@
        - + - + - + @@ -267,4 +170,4 @@
      • {{ srOnlyText }}
      -
+
\ No newline at end of file diff --git a/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts b/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts index 625e9dcdd..fd5951b0b 100755 --- a/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts +++ b/src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts @@ -202,6 +202,7 @@ export class SAMSDSAutocompleteSearchComponent implements ControlValueAccessor { * @param event */ checkForFocus(event): void { + console.log(this.model, '---focusout----') if (this.configuration) { if ( this.configuration.isTagModeEnabled || @@ -227,6 +228,11 @@ export class SAMSDSAutocompleteSearchComponent implements ControlValueAccessor { } } + clickOutSide(event): void { + this.focusRemoved(); + this.showResults = false; + } + /** * */ @@ -239,15 +245,17 @@ export class SAMSDSAutocompleteSearchComponent implements ControlValueAccessor { if (this.configuration.isTagModeEnabled || this.configuration.isFreeTextEnabled) { if ( SAMSDSSelectedItemModelHelper.containsItem( - val, + val[this.configuration.primaryKeyField], this.configuration.primaryKeyField, this.model.items ) ) { + console.log('test outside') SAMSDSSelectedItemModelHelper.clearItems(this.model); this.propogateChange(this.model); this.selectItem(this.createFreeTextItem(val)); - } else { + } else if (this.model.items.length <= 0) { + console.log('else test outside') this.selectItem(this.createFreeTextItem(val)); } }