Skip to content

Commit 95251d7

Browse files
committed
refactor(chat): do not expose non-public components, remove timeout
1 parent 05a0063 commit 95251d7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/components/chat/chat-input.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export default class IgcChatInputComponent extends LitElement {
4343
);
4444
}
4545

46-
@query('textarea')
47-
private textInputElement!: HTMLTextAreaElement;
46+
@query(IgcTextareaComponent.tagName)
47+
private textInputElement!: IgcTextareaComponent;
4848

4949
@watch('acceptedFiles', { waitUntilFirstUpdate: true })
5050
protected acceptedFilesChange(): void {
@@ -209,9 +209,9 @@ export default class IgcChatInputComponent extends LitElement {
209209
this.textInputElement.style.height = 'auto';
210210
}
211211

212-
setTimeout(() => {
212+
this.updateComplete.then(() => {
213213
this.textInputElement?.focus();
214-
}, 0);
214+
});
215215
}
216216

217217
private handleFileUpload(e: Event) {

src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ export { default as IgcCarouselComponent } from './components/carousel/carousel.
1515
export { default as IgcCarouselIndicatorComponent } from './components/carousel/carousel-indicator.js';
1616
export { default as IgcCarouselSlideComponent } from './components/carousel/carousel-slide.js';
1717
export { default as IgcChatComponent } from './components/chat/chat.js';
18-
export { default as IgcChatInputComponent } from './components/chat/chat-input.js';
19-
export { default as IgcChatMessageComponent } from './components/chat/chat-message.js';
20-
export { default as IgcChatMessageListComponent } from './components/chat/chat-message-list.js';
21-
export { default as IgcChatMessageAttachmentsComponent } from './components/chat/message-attachments.js';
2218
export { default as IgcCheckboxComponent } from './components/checkbox/checkbox.js';
2319
export { default as IgcCircularProgressComponent } from './components/progress/circular-progress.js';
2420
export { default as IgcCircularGradientComponent } from './components/progress/circular-gradient.js';

0 commit comments

Comments
 (0)