sindresorhus/refined-github

`avoid-accidental-submissions`: Do not allow a second enter to trigger the action #4581

stdedos posted onGitHub

If I am reading https://github.com/sindresorhus/refined-github/pull/4556 correctly, a second Enter (at whatever time) will trigger the action underneath.

Is there a way for that to never happen? I like the differentiation of the commit action to be Ctrl+Enter at all cases.


Nice GitHub lost my comment when I tried to edit it. In short itā€™s meant to just make you focus rather than completely prevent it. That feature can be written as a userscript in 4 lines of code, but Iā€™d rather not do that here because it would be as annoying as dropping the ā€œBackspace to go backā€ in Chrome IMHO

posted by fregante over 3 years ago

Nice GitHub lost my comment

Here it is if you need it:

The feature was changed to show the message in order to make you focus while typing, rather than annoyingly change field or completely block the key. If you want a global block of the enter key, it can be written separately with a few lines (but not as part of Refined GitHub), probably:

document.addEventListener(event => {
  if (event.target.closest('input') && !$('.suggester')
    event.preventDefault()
  }
})

E-mails-for-comments only fire exactly once, immediately šŸ˜‰

because it would be as annoying as dropping the ā€œBackspace to go backā€ in Chrome IMHO

I was wondering: can't scripts have options? If so, this looks like a prime candidate (it's just a boolean)

posted by stdedos over 3 years ago

E-mails-for-comments only fire exactly once, immediately šŸ˜‰

Thanks! Unfortunately I had extended that piece of code to actually make it work after the submission, but oh well.

I was wondering: can't scripts have options?

https://github.com/sindresorhus/refined-github/issues/2960#issuecomment-606765658

posted by fregante over 3 years ago

I think the feature accomplishes its purpose the way it is now

posted by fregante over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests