🛠️ fix: Correct Unwanted Newlines after Undo in Textarea #2289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hopefully the last of Textarea changes, this one targeting a chrome quirk.
I enhanced the undo functionality in LibreChat's textarea to fix a Chrome-specific bug that left unwanted newlines after undoing pasted content. The purpose of this improvement is to ensure a smoother user experience, especially when users need to undo their actions within the chat input field.
Other Changes
Change Type
Testing
To ensure the fix worked as intended, I replicated the problematic scenario by:
Test Configuration:
I specifically focused on testing in Chrome, as the bug was Chrome-specific. However, I also verified behavior in Firefox and Safari to ensure my fix did not adversely affect functionality in those browsers.
For effective testing, one should:
Ctrl+Z
(orCmd+Z
on a Mac).Additionally, try starting with text already present in the textarea, then paste and undo to ensure the logic correctly handles content before the cursor.
Checklist