igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

feat(combo, simple-combo): hide clear icon when custom template is empty

Open georgianastasov opened this issue 1 year ago • 1 comments

Closes #14104

Additional information (check all that apply):

  • [ ] Bug fix
  • [x] New functionality
  • [ ] Documentation
  • [ ] Demos
  • [ ] CI/CD

Checklist:

  • [x] All relevant tags have been applied to this PR
  • [ ] This PR includes unit tests covering all the new code (test guidelines)
  • [ ] This PR includes API docs for newly added methods/properties (api docs guidelines)
  • [ ] This PR includes feature/README.MD updates for the feature docs
  • [ ] This PR includes general feature table updates in the root README.MD
  • [x] This PR includes CHANGELOG.MD updates for newly added functionality
  • [ ] This PR contains breaking changes
  • [ ] This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • [ ] This PR includes behavioral changes and the feature specification has been updated with them

georgianastasov avatar Apr 25 '24 09:04 georgianastasov

LGTM, though this missed the window for 17.2 and will likely land in 18.0 so the changelog will need an update. No rush though. Also, @simeonoff If you can quickly take a quick look to make sure we're not doing something silly, wouldn't mind :)

damyanpetev avatar Apr 29 '24 15:04 damyanpetev

Having combo set like this:

<igx-combo [data]="uniqueFalsyData" [displayKey]="'field'" [valueKey]="'value'">
    <ng-template igxComboClearIcon>
        <igx-icon>home</igx-icon>
    </ng-template>
</igx-combo>

<igx-combo [data]="uniqueFalsyData" [displayKey]="'field'" [valueKey]="'value'">
    <ng-template igxComboClearIcon>
    </ng-template>
</igx-combo>

I am ending up with clear icon like this: image

I am not even able now to change the clear icon!

wnvko avatar May 14 '24 11:05 wnvko

@wnvko I've investigated further, and it seems like the issue persists even when I comment out my changes and also when i test it on the master branch. I think that the problem might not be specific to this style changes but could be a new separate issue.

georgianastasov avatar May 14 '24 12:05 georgianastasov

@wnvko @georgianastasov would anyone mind dropping a repro stackblitz or something? No reason I can see for the template override not to work all of a sudden. The only logical would be if the IgxComboClearIconDirective is not imported which would cause the query to not find a match and won't produce any errors for the template 'attribute' most likely.

damyanpetev avatar May 14 '24 13:05 damyanpetev

@damyanpetev Yes, indeed, the IgxComboClearIconDirective is not imported by default in the combo.sample.ts file and also we missed importing the IGX_COMBO_DIRECTIVES, which caused the described behavior.

georgianastasov avatar May 14 '24 13:05 georgianastasov