Open freedompraise opened 2 months ago
I don't think this has been entirely solved by https://github.com/jsolly/awesome-django-blog/pull/461
If I open the chatbox and immediately press enter, an empty message is sent (expected), but the chat send box remains expanded.
In this GIF, I am simply hitting the enter key repeatedly. The chatbox should be shrunk to the original size whenever a message is sent.
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:
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