igniteui-angular
igniteui-angular copied to clipboard
feat(combo, simple-combo): hide clear icon when custom template is empty
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.MDupdates for the feature docs - [ ] This PR includes general feature table updates in the root
README.MD - [x] This PR includes
CHANGELOG.MDupdates for newly added functionality - [ ] This PR contains breaking changes
- [ ] This PR includes
ng updatemigrations for the breaking changes (migrations guidelines) - [ ] This PR includes behavioral changes and the feature specification has been updated with them
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 :)
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:
I am not even able now to change the clear icon!
@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.
@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 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.