Skip to content

Commit

Permalink
feat(dropdown list): add checkmark to selected list item
Browse files Browse the repository at this point in the history
  • Loading branch information
Donisius committed Jul 13, 2020
1 parent a62a10d commit baf688c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dropdown/dropdown.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ScrollableList } from "./scrollable-list.directive";
import { I18nModule } from "./../i18n/index";
import { PlaceholderModule } from "./../placeholder/index";
import { DropdownService } from "./dropdown.service";
import { ChevronDownModule, WarningFilledModule } from "@carbon/icons-angular";
import { ChevronDownModule, WarningFilledModule, CheckmarkModule } from "@carbon/icons-angular";
import { UtilsModule } from "./../utils/utils.module";

@NgModule({
Expand All @@ -25,6 +25,7 @@ import { UtilsModule } from "./../utils/utils.module";
],
imports: [
CommonModule,
CheckmarkModule,
FormsModule,
I18nModule,
PlaceholderModule,
Expand Down
6 changes: 6 additions & 0 deletions src/dropdown/list/dropdown-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ import { ScrollCustomEvent } from "./scroll-custom-event.interface";
</label>
</div>
<ng-container *ngIf="!listTpl && type === 'single'">{{item.content}}</ng-container>
<svg
*ngIf="!listTpl && type === 'single'"
ibmIconCheckmark
size="16"
class="bx--list-box__menu-item__selected-icon">
</svg>
<ng-template
*ngIf="listTpl"
[ngTemplateOutletContext]="{item: item}"
Expand Down

0 comments on commit baf688c

Please sign in to comment.