Skip to content

[CSS]: CSS not applying corretly #1320

Open
@relez

Description

@relez

Hi there, I am working on a ListView that highlights the elements when the user taps on a specific item. I am trying to add a CSS style to make it looks like its selected but seems like its not adding the style. This is my HTML code:

<ListView #selectListView [items]="_auxSelectItems" (itemTap)="onItemTap($event)">
    <ng-template let-item="item">
        <Label [class]="'item item-content top-left-rounded top-right-rounded bot-left-rounded bot-right-rounded ' + (this._selectedItemsCheck[item.ID] ? 'item-selected' : '')" [text]="item.Description" textWrap="true" style="padding:10;"></Label>
    </ng-template>
</ListView>

In the onItemTap event I have this code...

onItemTap(event: ItemEventData) : void {
    let lb = <Label>event.view;
    lb.cssClasses.add("font-bold");
    // also tried:
    lb.className = "font-bold";
}

The font-bold rule is defined in a css file like this:

.font-bold {
    font-weight: bold;
}

Am I missing something? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions