A few small UI fixes (#3310)

This commit is contained in:
Fesaa 2024-10-26 17:13:00 +02:00 committed by GitHub
parent 841db594c5
commit 7043bc566a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -225,7 +225,7 @@ export class GroupedTypeaheadComponent implements OnInit {
close(event?: FocusEvent) { close(event?: FocusEvent) {
if (event) { if (event) {
// If the user is tabbing out of the input field, check if there are results first before closing // If the user is tabbing out of the input field, check if there are results first before closing
if (this.hasData) { if (this.hasData || this.searchTerm) {
return; return;
} }
} }

View File

@ -42,8 +42,10 @@ export class ReadMoreComponent implements OnChanges {
} }
determineView() { determineView() {
const text = this.text ? this.text.replace(/\n/g, '<br>') : '';
if (!this.text || this.text.length <= this.maxLength) { if (!this.text || this.text.length <= this.maxLength) {
this.currentText = this.text; this.currentText = text;
this.isCollapsed = true; this.isCollapsed = true;
this.hideToggle = true; this.hideToggle = true;
this.cdRef.markForCheck(); this.cdRef.markForCheck();
@ -52,11 +54,11 @@ export class ReadMoreComponent implements OnChanges {
this.hideToggle = false; this.hideToggle = false;
if (this.isCollapsed) { if (this.isCollapsed) {
this.currentText = this.text.substring(0, this.maxLength); this.currentText = text.substring(0, this.maxLength);
this.currentText = this.currentText.substring(0, Math.min(this.currentText.length, this.currentText.lastIndexOf(' '))); this.currentText = this.currentText.substring(0, Math.min(this.currentText.length, this.currentText.lastIndexOf(' ')));
this.currentText = this.currentText + '…'; this.currentText = this.currentText + '…';
} else if (!this.isCollapsed) { } else if (!this.isCollapsed) {
this.currentText = this.text; this.currentText = text;
} }
this.cdRef.markForCheck(); this.cdRef.markForCheck();