diff --git a/UI/Web/src/app/nav/_components/grouped-typeahead/grouped-typeahead.component.ts b/UI/Web/src/app/nav/_components/grouped-typeahead/grouped-typeahead.component.ts index d805d4941..894ac2192 100644 --- a/UI/Web/src/app/nav/_components/grouped-typeahead/grouped-typeahead.component.ts +++ b/UI/Web/src/app/nav/_components/grouped-typeahead/grouped-typeahead.component.ts @@ -225,7 +225,7 @@ export class GroupedTypeaheadComponent implements OnInit { close(event?: FocusEvent) { if (event) { // 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; } } diff --git a/UI/Web/src/app/shared/read-more/read-more.component.ts b/UI/Web/src/app/shared/read-more/read-more.component.ts index 8edfaba43..1a4c4a5a0 100644 --- a/UI/Web/src/app/shared/read-more/read-more.component.ts +++ b/UI/Web/src/app/shared/read-more/read-more.component.ts @@ -42,8 +42,10 @@ export class ReadMoreComponent implements OnChanges { } determineView() { + const text = this.text ? this.text.replace(/\n/g, '
') : ''; + if (!this.text || this.text.length <= this.maxLength) { - this.currentText = this.text; + this.currentText = text; this.isCollapsed = true; this.hideToggle = true; this.cdRef.markForCheck(); @@ -52,11 +54,11 @@ export class ReadMoreComponent implements OnChanges { this.hideToggle = false; 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 + '…'; } else if (!this.isCollapsed) { - this.currentText = this.text; + this.currentText = text; } this.cdRef.markForCheck();