Repository navigation
Conversation
fregante
left a comment
There was a problem hiding this comment.
This is not what I meant, GitHub has a native behavior enabled via attributes (data-disabled-with?) so we should just use that
|
Updated this to use GitHub’s native I couldn’t verify the Safari-specific runtime behavior from Windows/Chromium because GitHub’s native primary button stays enabled during upload there, so Chromium doesn’t reproduce the original issue. |
|
I'd only consider a solution that is able to use GitHub's own handler for this without requiring explicit listeners or otherwise a bunch of code. It's "a small bug" and it deserves "a small fix" only |
|
I think there's a safer way:
This avoids any issues that come from using |
|
Implemented the safer approach you suggested: the Draft button now follows the primary button in the DOM, visual ordering is preserved with flex, and the Draft button is hidden via the adjacent-sibling rule while the primary button is disabled. No explicit upload listeners were added. CI is green on the current head. Marking this ready for re-review. Thanks! |
fregante
left a comment
There was a problem hiding this comment.
Also ensure that this still works on the gist creation page
| Number(a.classList.contains('rgh-draft-pr-button')) | ||
| - Number(b.classList.contains('rgh-draft-pr-button')), | ||
| ); | ||
| initialGroupedButtons.after(...buttons); |
There was a problem hiding this comment.
Why do all this? The order is set in the initial query selector:
$$('.select-menu-item', initialGroupedButtons).toReversed()| } | ||
|
|
||
| .btn-primary:disabled + .rgh-draft-pr-button { | ||
| opacity: 0.5; |
one-click-pr-or-gist: disable draft button during uploadone-click-pr-or-gist - Disable draft button during upload



Closes #10118
Test URLs
https://github.com/refined-github/sandbox/compare/default-a...other?expand=1
Screenshot
During upload:
After upload: