Skip to content

Commit

Permalink
Revert "fix: add logs to autocomplete textarea"
Browse files Browse the repository at this point in the history
This reverts commit 6d41ab1.
  • Loading branch information
szuperaz committed Sep 3, 2024
1 parent 5a8ae44 commit 9adc5c6
Showing 1 changed file with 2 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,13 @@ export class AutocompleteTextareaComponent
}
if (changes.value && !this.value && this.messageInput) {
this.messageInput.nativeElement.style.height = 'auto';
this.chatClientService.chatClient.logger(
'info',
'[Autocomplete textarea] Value reset, adjusting textarea height to auto'
);
this.updateMentionedUsersFromText();
} else if (
changes.value &&
this.value &&
this.messageInput &&
this.isViewInited
) {
this.chatClientService.chatClient.logger(
'info',
'[Autocomplete textarea] Value changed'
);
setTimeout(() => {
if (this.messageInput.nativeElement.scrollHeight > 0) {
this.adjustTextareaHeight();
Expand All @@ -225,10 +217,6 @@ export class AutocompleteTextareaComponent

ngAfterViewInit(): void {
this.isViewInited = true;
this.chatClientService.chatClient.logger(
'info',
'[Autocomplete textarea] View inited'
);
if (this.messageInput.nativeElement.scrollHeight > 0) {
this.adjustTextareaHeight();
}
Expand Down Expand Up @@ -263,10 +251,6 @@ export class AutocompleteTextareaComponent

inputChanged() {
this.valueChange.emit(this.messageInput.nativeElement.value);
this.chatClientService.chatClient.logger(
'info',
'[Autocomplete textarea] Input changed'
);
this.adjustTextareaHeight();
}

Expand All @@ -283,20 +267,8 @@ export class AutocompleteTextareaComponent
}

private adjustTextareaHeight() {
const necessaryHeight = `${this.messageInput.nativeElement.scrollHeight}px`;
if (this.messageInput.nativeElement.style.height === necessaryHeight) {
this.chatClientService.chatClient.logger(
'info',
`[Autocomplete textarea] No need to adjust textarea height`
);
} else {
this.chatClientService.chatClient.logger(
'info',
`[Autocomplete textarea] Adjusting textarea height to ${necessaryHeight}`
);
this.messageInput.nativeElement.style.height = '';
this.messageInput.nativeElement.style.height = necessaryHeight;
}
this.messageInput.nativeElement.style.height = '';
this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`;
}

private transliterate(s: string) {
Expand Down

0 comments on commit 9adc5c6

Please sign in to comment.