Skip to content

Conversation

calycekr
Copy link
Contributor

  • Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.

Without this fix, textarea height adjustment occasionally fails to complete before the submit event fires. This inconsistent behavior creates a race condition where the UI may appear broken when pressing Enter, as the height adjustment is scheduled but not guaranteed to be applied in time.

The fix targets specifically the handleKeydown function to maintain performance while ensuring the textarea always renders with the correct height in all cases before submission.

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
@nsarrazin nsarrazin merged commit 2360be8 into huggingface:main Jun 16, 2025
3 checks passed
maksym-work pushed a commit to siilats/chat-ui that referenced this pull request Jul 2, 2025
…ngface#1854)

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
Matsenas pushed a commit to Matsenas/chat-ui that referenced this pull request Jul 4, 2025
…ngface#1854)

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
Matsenas pushed a commit to Matsenas/chat-ui that referenced this pull request Jul 4, 2025
…ngface#1854)

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
gary149 pushed a commit to gary149/chat-ui that referenced this pull request Aug 29, 2025
…ngface#1854)

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
gary149 pushed a commit to gary149/chat-ui that referenced this pull request Aug 29, 2025
…ngface#1854)

- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants