sindresorhus/refined-github

Disable `Request changes` button when no comment left #2401

mcristina422 posted onGitHub

When reviewing a pull-request the Comment, Request changes, and Approve buttons are enabled.

image To request changes, a comment must be left. If you click the button without leaving a comment the message is presented: You need to leave a comment indicating the requested changes.

Feature Request:

Disable the Request changes button when the text field is empty, preventing the user from accidentally attempting to leave an empty review


Regular comment fields have a similar behavior: the comment button is disabled until a comment is entered. We should use the same behavior, it’s probably triggered by a required attribute on the field plus some class on the buttons.

Then, to allow a comment-less Approve, the approve button’s click should skip validation, probably via approve.onclick = form.submit(), making sure that this doesn’t break when the Approve button is completely disabled (e.g. on your own PRs)

Does this make sense? 😅

posted by fregante over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests