You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user types in multiple paragraphs, the textarea expands as expected. However, after sending the message, the textarea does not shrink back to its default size. It remains expanded even though the content has been cleared.
Steps to Reproduce
Open the chatbox.
Type a message with multiple lines or paragraphs, causing the textarea to expand.
Press "Enter" to send the message.
Observe that the textarea remains expanded even after the message is sent and the content is cleared.
Expected Behavior
The textarea should reset to its default height after the message is sent and the content is cleared.
Current Behavior
The textarea retains its expanded height after the message is sent, leading to unnecessary space being displayed.
Possible Solution
The issue might be due to the way the height is being handled. After clearing the textarea, it seems the height property isn’t recalculated. We need to ensure that the height is explicitly reset after the textarea is cleared.
Here’s a potential fix:
Reset the height manually after sending the message:
Try the following update in the onSendButton method:
onSendButton(){consttextField=this.chatBox.querySelector("#question-text-area");consttext=textField.value.trim();if(text===""||text==="\n"){return;}this.updateChatText(text);textField.value="";// Explicitly reset the textarea heighttextField.style.height="";// Reset height to the default/minimum height}
The key change should be that setting textField.style.height = "";, ensures the textarea reverts to its default height, but it's not working as supposed
Record
I have read the Contributing Guidelines
I have searched the issues for a similar request
I want to work on this issue
The text was updated successfully, but these errors were encountered:
Issue Description
When the user types in multiple paragraphs, the textarea expands as expected. However, after sending the message, the textarea does not shrink back to its default size. It remains expanded even though the content has been cleared.
Steps to Reproduce
Expected Behavior
The textarea should reset to its default height after the message is sent and the content is cleared.
Current Behavior
The textarea retains its expanded height after the message is sent, leading to unnecessary space being displayed.
Possible Solution
The issue might be due to the way the height is being handled. After clearing the textarea, it seems the height property isn’t recalculated. We need to ensure that the height is explicitly reset after the textarea is cleared.
Here’s a potential fix:
Try the following update in the
onSendButton
method:The key change should be that setting
textField.style.height = "";
, ensures the textarea reverts to its default height, but it's not working as supposedRecord
The text was updated successfully, but these errors were encountered: