Skip to content

Commit f7d9bd3

Browse files
Fixed Text Size Issue
1 parent ee58089 commit f7d9bd3

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/pages/home/home.page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"
5454
*cdkVirtualFor="let package of packages | filter: currentSearch"
5555
>
56-
<div class="flex-grow font-medium pr-2">
56+
<div class="title flex-grow font-medium pr-2">
5757
<h2 class="font-bold">{{package[0]}}</h2>
5858
<p class="text-sm font-normal text-gray-500 tracking-wide">
5959
{{package[1]}} - {{package[2]}}
@@ -100,7 +100,7 @@ <h2 class="font-bold">{{package[0]}}</h2>
100100
*cdkVirtualFor="let package of installed | filter: currentSearch ; trackBy:trackBy"
101101
>
102102
<div
103-
class="font-medium pr-2 flex-grow"
103+
class="title font-medium pr-2 flex-grow"
104104
style="max-width: calc(100% - 85px)"
105105
>
106106
<h2 class="font-bold">{{package[0]}}</h2>

src/pages/home/home.page.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,15 @@ cdk-virtual-scroll-viewport {
1717
.item {
1818
height: 55px;
1919
width: 100%;
20+
.title {
21+
max-width: calc(100% - 60px);
22+
h2,
23+
p {
24+
text-overflow: ellipsis;
25+
overflow: hidden;
26+
width: 100%;
27+
height: 1.2em;
28+
white-space: nowrap;
29+
}
30+
}
2031
}

src/pages/home/home.page.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* eslint-disable no-async-promise-executor */
44
/* eslint-disable @typescript-eslint/no-misused-promises */
55
import { HttpClient } from '@angular/common/http';
6-
import { Component, OnInit } from '@angular/core';
6+
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
77
import { LoadingController, ToastController } from '@ionic/angular';
88
import { CommandService } from '../../app/core/services/command.service';
99
import { ElectronService } from '../../app/core/services/electron.service';
@@ -24,7 +24,8 @@ export class HomePage implements OnInit {
2424
private loadingCtrl: LoadingController,
2525
private toastCtrl: ToastController,
2626
private http: HttpClient,
27-
private electronService: ElectronService
27+
private electronService: ElectronService,
28+
private cdr: ChangeDetectorRef
2829
) {}
2930

3031
async segmentChanged($event) {
@@ -203,6 +204,9 @@ export class HomePage implements OnInit {
203204
}
204205

205206
doSearch() {
206-
this.currentSearch = this.search;
207+
setTimeout(() => {
208+
this.currentSearch = this.search;
209+
this.cdr.detectChanges();
210+
}, 50);
207211
}
208212
}

0 commit comments

Comments
 (0)