From badf863776ca1374fbe54c0562197678d209a005 Mon Sep 17 00:00:00 2001 From: Florian Necas Date: Mon, 17 Jul 2023 09:30:56 +0200 Subject: [PATCH] feat: improve mobile display, long texts and undefined choices --- .../dropdown-selector/dropdown-selector.component.html | 4 ++-- .../lib/dropdown-selector/dropdown-selector.component.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html b/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html index 05a91a6f8c..817a38f115 100644 --- a/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +++ b/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html @@ -1,4 +1,4 @@ -
+
= Array<{ value: T }> +const DEFAULT_ROW_NUMBERS = 6 + @Component({ selector: 'gn-ui-dropdown-selector', templateUrl: './dropdown-selector.component.html', @@ -67,11 +69,14 @@ export class DropdownSelectorComponent implements OnInit { } getChoiceLabel(): string { - return this.selectedChoice.label + return ( + this.selectedChoice.label.substring(0, 50) + + (this.selectedChoice.label.length > 50 ? '...' : '') + ) } ngOnInit(): void { - if (!this.maxRows) this.maxRows = 6 + if (!this.maxRows) this.maxRows = DEFAULT_ROW_NUMBERS } isSelected(choice) {