-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Disable issue/PR comment button given empty input #31463
Disable issue/PR comment button given empty input #31463
Conversation
Usually disabling buttons is not good UX practice as users cannot know why it's disabled. It's better to disallow submitting form with error notification about what is missing/invalid to submit form |
Thanks for the review! As I explained in the desc I followed how GitHub handles this case (though I'm not sure if they inform the user about why it's disabled and I'm unable to check ATM). With that said, I do agree with you and will look into your approach when I get the time. |
I do not think it is a must for this case. Everyone should know that empty content is not allowed to be submitted if the button is disabled. And even more, it is quite hacky to add tooltip for a disabled element. So I prefer to go with this one, no more tooltip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wxiaoguang's approach sounds good
I'm not suggesting to add tooltip to disabled button but to not disable button and when clicked inform user that comment content is required |
I still prefer the current "disabled button" solution. The reason is:
|
* giteaofficial/main: Disable issue/PR comment button given empty input (go-gitea#31463) Simplify 404/500 page (go-gitea#31409) Fix web notification icon not updated once you read all notifications (go-gitea#31447) Switch to "Write" tab when edit comment again (go-gitea#31445) Add simple JS init performance trace (go-gitea#31459)
Given an empty issue/PR comment, the comment history would not be updated if the user were to submit it. Therefore, it would make since to just disable the comment button when the text editor is empty.
This is inline with what GitHub does when given empty text editor input.