Skip to content

Fix pressing "Enter" in the "add link" modal submitting the parent form#2024

Merged
ArtOfCode- merged 1 commit intodevelopfrom
0valt/2023/add-link-submit
Mar 20, 2026
Merged

Fix pressing "Enter" in the "add link" modal submitting the parent form#2024
ArtOfCode- merged 1 commit intodevelopfrom
0valt/2023/add-link-submit

Conversation

@Oaphi
Copy link
Copy Markdown
Member

@Oaphi Oaphi commented Mar 17, 2026

closes #2023

This is a "quick and dirty" version of the fix as I don't have full access to my usual tools at the moment (a proper fix would be moving the modal outside the markdown_tools partial as form tags can't be nested, wrapping the inputs in a <form> tag, and cancelling [preventDefault] any submit event on it - see the image_upload partial for how it should be done). Nevertheless, it should do the trick.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.76%. Comparing base (39d0527) to head (d712429).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
Components Coverage Δ
controllers 75.87% <ø> (-0.04%) ⬇️
helpers 85.09% <ø> (ø)
jobs 66.88% <ø> (ø)
models 93.01% <ø> (ø)
tasks 61.11% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@cellio cellio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works now -- pressing enter in either field (anchor text or link) does nothing, so you have to click the "insert" button to return to the editor. No premature post submissions.

@ArtOfCode- ArtOfCode- merged commit 4a18457 into develop Mar 20, 2026
13 checks passed
@ArtOfCode- ArtOfCode- deleted the 0valt/2023/add-link-submit branch March 20, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pressing Enter when trying to add a link to a post submits it instead

3 participants