Pressing Ctrl+Enter while typing a post can sometimes lose it

Discussions related to the forums itself. Call for moderators. Trash Posts area.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 749
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Pressing Ctrl+Enter while typing a post can sometimes lose it

Post by Hares »

When you want to submit your post, it's pretty common to use Ctrl+Enter. However, with this forum, it can sometimes reload the page instead. IDK why this happens and what are exact steps to reproduce.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 749
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: Pressing Ctrl+Enter while typing a post can sometimes lose it

Post by Hares »

Okay, I digged into it.
When you press Ctrl+Enter, accrording to editor.js, the closest form should submit.

Code: Select all

		$('textarea').on('keydown', function (e) {
			if (e.which === 13 && (e.metaKey || e.ctrlKey)) {
				$(this).closest('form').find(':submit').click();
			}
		});
In practice, this can lead to the weird interactions.
For example, I was writing the following comment in the 124776: Combinator cookbook 2.0 (comment write link: posting.php?mode=quote&p=665226#preview):

Code: Select all

[quote=gGeorg post_id=665226 time=1741623975 user_id=68465]
Unloading exact amount of items could take several combinators. 
You might try this trick made by one decider.
[/quote]

I've read this three times and it stills looks like a dark magic to me.
Then I pressed Ctrl+Enter and it lost the content. Since my comment was kinda small I was more curious than enraged, so I started digging.
I re-typed the exact same comment. Copied it via Ctrl+C. Used Ctrl+Enter. Page got reloaded. I used Ctrl+A to select everything (to be removed via Ctrl+V) and then Ctrl+V-ed it. You can estimate how frustrated was I when I got the following:

Code: Select all

0eNrlmf9u2zYQx1+F4F8tQBkWZSW1sBQYmrYYMGxFm/8cQ6Cli01UpjSKsmcEeoC+RZ+tT7LTjziOozWQIECehwAKRYl3xw+/R52se7qIMki0VIZ69zSENNAyMTJW1KNfQIUpmW2kNpmIrFQulYiuqn/WpzmpWgREsCJGroGYFZCNQINEqvJEQ0hm0sD6ClvWVmqYk+KI1wMNIoV0dKuuIRI7j3C0EXxNb9WteicUWQBJt9IEKzRhYqJgKYzcwLNwwnirLC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board history feature (Win+V) to show history, and the top-most record was indeed changed. I was not sure if this is caused by any of my extensions, so... so I used my Chrome profile I use for remote exams in my university (so this profile has no extensions at all), and the result was exactly the same. I tried decoding these base64 strings and didn't succeed. So, I give up. I post this here. I don't know what kind of dark black magic is going on but pls dispell this curse as being able to send messages via Ctrl+Enter is crucial part of my daily routine.

Edit: For this exact post, Ctrl+Enter worked fine. For the post edits containing attachments, Ctrl+Enter will destroy them (ref: 117527: Attachment disappears after submitting a post)
Nidan
Filter Inserter
Filter Inserter
Posts: 296
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Pressing Ctrl+Enter while typing a post can sometimes lose it

Post by Nidan »

Hares wrote: Mon Mar 10, 2025 10:47 pm I tried decoding these base64 strings and didn't succeed.
Base64 with a leading 0 is factorios format for blueprint strings. Decoding it (or importing it ingame) produces a blueprint containing some combinators called "Raising front detector".

Did the copy blueprint button for this particular bp have keyboard focus when you pressed ctrl-enter?
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 749
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: Pressing Ctrl+Enter while typing a post can sometimes lose it

Post by Hares »

Nidan wrote: Tue Mar 11, 2025 8:56 am
Hares wrote: Mon Mar 10, 2025 10:47 pm I tried decoding these base64 strings and didn't succeed.
Base64 with a leading 0 is factorios format for blueprint strings. Decoding it (or importing it ingame) produces a blueprint containing some combinators called "Raising front detector".

Did the copy blueprint button for this particular bp have keyboard focus when you pressed ctrl-enter?
No, the focus was on the text field, but it looks that the closest form detection for the hotkey results in a wrong form due to a copy blueprint plugin!
User avatar
atomizer
Fast Inserter
Fast Inserter
Posts: 130
Joined: Sat Sep 22, 2018 3:18 pm
Contact:

Re: Pressing Ctrl+Enter while typing a post can sometimes lose it

Post by atomizer »

blueprint buttons in topic review are evil in general 105063
Post Reply

Return to “This Forum”