question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`one-click-pr-or-gist`: In PR compare pages the "Create pull request" button is always enabled, even with empty title

See original GitHub issue

Please ensure:

  • The bug is caused by Refined GitHub. It doesn’t happen if I disable the extension.

Describe the problem and how to replicate it

Continuing https://github.com/sindresorhus/refined-github/pull/4556#issuecomment-879092209

In PR branch compare pages, e.g. https://github.com/darkred/test/compare/main...t2?expand=1, the “Create pull request” button is always enabled, even with empty title - (the expected behavior is to be disabled when the title is empty). Disabling the one-click-pr-or-gist feature fixes the problem.

See:

  • the attached screen capture for the issue, and
  • the screenshot for how it is (as expected) with the one-click-pr-or-gist feature disabled.

Screenshots/video/gif showing the issue, if it’s visual

125460626-c10fd7ed-b158-4ff3-9c4b-b48f395925a7 125460718-7b67d3e1-aa3c-42fa-ba44-906b35fd214e

Console errors, if any

No response

Example URL

https://github.com/darkred/test/compare/main...t2?expand=1

Browser(s) used

Chrome 91, Firefox 90

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fregantecommented, Jul 28, 2021
  1. If GitHub allows an empty body, we allow the empty body, and vice versa. In short just add the attribute and that’s it.
  2. What you mentioned about the attribute is just lint stuff that you can avoid discussing, just follow the linter. My code suggestions in comments aren’t meant to be 100% exact as I don’t write them in my editor
1reaction
fregantecommented, Jul 27, 2021

Thanks for the research! The hook should be button[data-disable-invalid], our button does not have that: https://github.com/sindresorhus/refined-github/blob/ae247fb90a4c4b20524d76c823e97af3881326fb/source/features/one-click-pr-or-gist.tsx#L31

In this case, it should be as easy as adding the attribute

 <button
 	className={classList.join(' ')}
 	aria-label={description}
 	type="submit"
 	name={radioButton.name}
 	value={radioButton.value}
+	data-disable-invalid
 >
 	{title}
 </button>,

or maybe

+	data-disable-invalid={true}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Pull Request Button is disabled - github - Stack Overflow
In my case, the pull request Title field didn't auto-populate like it usually does. Once I typed in a title, the button became...
Read more >
Create Pull Request button showing when there is an existing ...
After testing this issue, I do not believe the application is behaving out of the ordinary. There is always a slight lag in...
Read more >
Create Pull Request button on Pull Request page st...
I have new changes in my pull request, but the button is disabled. I suppose I'll try restarting. :) Any suggestions would be...
Read more >
More ways to keep your pull request branch up-to-date
To update by rebasing, click the drop down menu next to the Update Branch button, click Update with rebase, and then click Rebase...
Read more >
How to submit a pull request | Zell Liew
This video explains what a pull request is, and how to submit one. ... click on the Create pull request button at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found