-
Notifications
You must be signed in to change notification settings - Fork 11.7k
fix: Disable Send button when Composer is empty #35656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: Disable Send button when Composer is empty #35656
Conversation
- Updated the `disabled` condition to `!canSend || !typing`, removing `isEditing` from the logic. - Prevented message submission when the button is disabled. - Ensured the button is only enabled when text is being typed, regardless of editing state.
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Thank you for your contribution, but actually that behavior is intended: What those issues refer to is:
expected: actual behavior: Also when you confirm the Delete action, the composer should not be filled with the previous message.
expected: actual behavior: Would be great if you could fix those :) |
- Updated `secondary` and `info` props to depend only on `typing`, excluding `isEditing`. - Previously, when disabled, the button remained highlighted in light blue instead of graying out, which was not visually correct. Now, it properly grays out.
Hi @juliajforesti ! However, I made two PRs with one key difference in how the Cancel button handles the Composer state. The first PR 35653 does the following:
The second PR 35655 does the following:
The PR titles of 35653 and 35655 might be confusing. However, to put it in context, 35653 originally ensured that the expected behavior you stated is reflected in the branch I created. Meanwhile, 35655 is a branch created from 35653 that modifies a few lines of code to restore the cleared edit message. This was created as an optional choice, showcasing all the possible fixes I could come up with. I would highly recommend checking the videos for both 35653 and 35655. I would make changes to my comments if you need any clarity as this is my first time with PRs, and I am very verbose with explanations. |
Description
This PR updates the logic for disabling the Send button in the message composer. Previously, the button was disabled based on both
typing
andisEditing
, butisEditing
is irrelevant to whether a message can be sent.Changes
disabled
condition to!canSend || !typing
, ensuring the button is only enabled when text is entered.isEditing
for button state.Why this is needed
isEditing
, leading to cases where the button was enabled even when no text was present.canSend
) and has entered text (typing
).Testing
disabled
condition to!canSend || !typing
, removingisEditing
from the logic.Proposed changes (including videos or screenshots)
2cd9c59
disabled
condition to!canSend || !typing
, removingisEditing
from the logic.Screen.Recording.2025-03-30.193324.mp4
Issue(s)
#35650
Further comments
35655 and 35653 are PRs that add two workflows such that a warning modal shows up if the edited text is empty.
This PR properly patches this by implementing correct condition checking without altering any chat flows.