1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-27 17:28:34 +00:00
forgejo/web_src/js
Danko Aleksejevs 39e6785da0 fix(ui): erroneous list continuation on Cmd+Enter on macOS (#8153) (#8170)
The line continuation code in the Markdown editor ignored Enter presses if Ctrl, Alt or Shift were being held. This now also accounts for Cmd on macOS (which browsers represent as metaKey).

### Tests

- Use Safari (on macOS)
- create a new issue in a repository
- start writing a list (with - one[enter]- two)
- now press Cmd+Enter
- verify that while the form is being submitted, no new line got visually added

***

The visual evidence of this bug is a race condition (form is being edited while also being submitted) and I don't think a reliable cross-browser E2E test is possible.

Bugged and fixed behavior verified manually on an actual Macbook in current Safari. Specifically,

* Before the fix: pressing Cmd+Enter submits the form *and* inserts a newline + list prefix in the markdown editor.  Reporter had the changed content submitted, I only saw it submit the original (but the change was visible during submission).
* After the fix: Cmd+Enter only submits the form. Enter with no modifiers inserts newlines/prefixes as before.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8170
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2025-06-23 15:21:15 +02:00
..
components [gitea] week 2025-22 cherry pick (gitea/main -> forgejo) (#8198) 2025-06-17 18:28:07 +02:00
features fix(ui): erroneous list continuation on Cmd+Enter on macOS (#8153) (#8170) 2025-06-23 15:21:15 +02:00
markup chore: Update katex import path 2024-12-18 01:17:23 +01:00
modules Reimplement editor Tab handling with accessibility safeguards (#6813) 2025-05-25 19:17:03 +02:00
render add model viewer for .glb (GLTF) model in file view (#8111) 2025-06-21 14:42:35 +02:00
standalone [CHORE] Proper chunking for swagger 2024-08-22 15:48:05 +02:00
utils Update dependency eslint-plugin-unicorn to v57 (forgejo) (#7181) 2025-03-09 20:49:49 +00:00
vendor Vendor jquery.are-you-sure with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Make relative-time a self-maintaining custom element (#8134) 2025-06-10 20:12:21 +02:00
bootstrap.js Suppress Monaco JavaScript errors in Safari (#3805) 2024-05-18 21:07:09 +00:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
htmx.js Auto-update the system status in admin dashboard (#29163) 2024-02-17 23:24:31 +01:00
index.js add model viewer for .glb (GLTF) model in file view (#8111) 2025-06-21 14:42:35 +02:00
jquery.js Forbid variables containing jQuery collections not having the $ prefix (#29839) 2024-03-20 08:46:30 +01:00
svg.js Reimplement editor Tab handling with accessibility safeguards (#6813) 2025-05-25 19:17:03 +02:00
svg.test.js Remove "class-name" from svg icon (#33540) 2025-02-25 12:56:30 +01:00
utils.js chore: add new lint rules 2024-10-23 08:10:18 +02:00
utils.test.js Update dependency happy-dom to v16 (forgejo) (#6454) 2025-01-07 11:38:58 +00:00
vitest.setup.js [BUG] Render emojis in labels in issue info popup 2024-03-30 11:18:46 +01:00