Within the listview items, there is a label that should expand when clicked. For example, initially it only shows one line of text. Upon clicking on the label, it should expand to show 10 lines of text.
Current Issue:
At present, when I click on the first listview item label, it expands perfectly to display 10 lines using textWrap. However, it also automatically expands the label of the fourth list item.
Desired Outcome:
When clicking on the first listview item label, only that specific label should expand with textWrap. The expansion should not affect the label in the fourth list item.
Below is the relevant code snippet:
Typescript file:
onClickList(args: EventData, index: number): void {
let labelArg = <Label>args.object;
var listview: ListView = <ListView>this.page.getViewById("listviewId");
listview.refresh();
labelArg.textWrap = true;
listview.refresh();
}
HTML file:
<ListView id="listviewId" [items]="_myFeedsList" class="list-group">
<ng-template let-item="item" let-i="index">
<StackLayout id="stackId">
....... .......
<Label textWrap="false" id="labelID" [text]="item.data" (tap)="onClickList($event, i)"></Label>
</StackLayout>
</ng-template>
</ListView>