@@ -28,6 +28,7 @@ import { debounceTime } from 'rxjs/operators';
28
28
import { TransliterationService } from '../../transliteration.service' ;
29
29
import { EmojiInputService } from '../emoji-input.service' ;
30
30
import { CustomTemplatesService } from '../../custom-templates.service' ;
31
+ import { ThemeService } from '../../theme.service' ;
31
32
32
33
/**
33
34
* The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.
@@ -132,6 +133,7 @@ export class AutocompleteTextareaComponent
132
133
private transliterationService : TransliterationService ,
133
134
private emojiInputService : EmojiInputService ,
134
135
private customTemplatesService : CustomTemplatesService ,
136
+ private themeService : ThemeService ,
135
137
private cdRef : ChangeDetectorRef
136
138
) {
137
139
this . searchTerm$ . pipe ( debounceTime ( 300 ) ) . subscribe ( ( searchTerm ) => {
@@ -198,21 +200,13 @@ export class AutocompleteTextareaComponent
198
200
}
199
201
if ( changes . value && ! this . value && this . messageInput ) {
200
202
this . messageInput . nativeElement . style . height = 'auto' ;
201
- this . chatClientService ?. chatClient ?. logger ?.(
202
- 'info' ,
203
- '[Autocomplete textarea] Value reset, adjusting textarea height to auto'
204
- ) ;
205
203
this . updateMentionedUsersFromText ( ) ;
206
204
} else if (
207
205
changes . value &&
208
206
this . value &&
209
207
this . messageInput &&
210
208
this . isViewInited
211
209
) {
212
- this . chatClientService ?. chatClient ?. logger ?.(
213
- 'info' ,
214
- '[Autocomplete textarea] Value changed'
215
- ) ;
216
210
setTimeout ( ( ) => {
217
211
if ( this . messageInput . nativeElement . scrollHeight > 0 ) {
218
212
this . adjustTextareaHeight ( ) ;
@@ -223,10 +217,6 @@ export class AutocompleteTextareaComponent
223
217
224
218
ngAfterViewInit ( ) : void {
225
219
this . isViewInited = true ;
226
- this . chatClientService ?. chatClient ?. logger ?.(
227
- 'info' ,
228
- '[Autocomplete textarea] View inited'
229
- ) ;
230
220
if ( this . messageInput . nativeElement . scrollHeight > 0 ) {
231
221
this . adjustTextareaHeight ( ) ;
232
222
}
@@ -261,10 +251,6 @@ export class AutocompleteTextareaComponent
261
251
262
252
inputChanged ( ) {
263
253
this . valueChange . emit ( this . messageInput . nativeElement . value ) ;
264
- this . chatClientService ?. chatClient ?. logger ?.(
265
- 'info' ,
266
- '[Autocomplete textarea] Input changed'
267
- ) ;
268
254
this . adjustTextareaHeight ( ) ;
269
255
}
270
256
@@ -281,20 +267,8 @@ export class AutocompleteTextareaComponent
281
267
}
282
268
283
269
private adjustTextareaHeight ( ) {
284
- const necessaryHeight = `${ this . messageInput . nativeElement . scrollHeight } px` ;
285
- if ( this . messageInput . nativeElement . style . height === necessaryHeight ) {
286
- this . chatClientService ?. chatClient ?. logger ?.(
287
- 'info' ,
288
- `[Autocomplete textarea] No need to adjust textarea height`
289
- ) ;
290
- } else {
291
- this . chatClientService ?. chatClient ?. logger ?.(
292
- 'info' ,
293
- `[Autocomplete textarea] Adjusting textarea height to ${ necessaryHeight } `
294
- ) ;
295
- this . messageInput . nativeElement . style . height = '' ;
296
- this . messageInput . nativeElement . style . height = necessaryHeight ;
297
- }
270
+ this . messageInput . nativeElement . style . height = '' ;
271
+ this . messageInput . nativeElement . style . height = `${ this . messageInput . nativeElement . scrollHeight } px` ;
298
272
}
299
273
300
274
private transliterate ( s : string ) {
0 commit comments