Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

plugin-forms: textarea in FormEmbed renders with whitespace as its initial value

Open Beginner friendly
#3,935 4 comments 0 reactions 2 assignees View on GitHub

Maintainers usually reply within 1 day

@Cloud-Xero is already working on this.

Since Oct 8, 2026.

  • #4078 by @Cloud-Xero — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Read packages/plugins/forms/src/astro/FormEmbed.astro, especially the textarea markup around lines 127–129. Check how the default value is placed between the tags and verify the rendered content when defaultValue is unset. Done means the empty field renders with no whitespace value while a supplied default remains intact.

Written by the indexing model from the issue text.

Description

area/plugins bot:bug bot:human-owned bug priority/low
Description

The <textarea> rendered by FormEmbed.astro in @emdash-cms/plugin-forms is not empty when the field has no default value. It contains the newline and indentation from the component source (8 tabs + newline + 7 tabs, 16 characters after the browser drops the leading newline).

As a result:

  • The caret starts on the second line, after the indentation, when a visitor focuses the field.
  • Browser validation for required / minlength treats the field as filled, so an untouched textarea passes client-side validation. The server trims the value before validating, so empty data is not saved, but the visitor gets a server-side error instead of the browser's inline message.

Expected: the textarea is empty when defaultValue is unset.

Cause: in packages/plugins/forms/src/astro/FormEmbed.astro (lines 127-129 on main), the expression sits on its own indented line between the tags:

							>
								{field.defaultValue || ""}
							</textarea>

Astro keeps whitespace inside <textarea> as-is, so the indentation becomes the value. Putting the expression on the same line as the tags fixes it:

							>{field.defaultValue || ""}</textarea>

We have applied this one-line change as a local patch (pnpm patch) since 0.2.4, and it still applies cleanly to 0.2.9. Happy to open a PR with a test if that helps.

Steps to reproduce
  1. Install @emdash-cms/plugin-forms and create a form with a textarea field that has no defaultValue and required: true.
  2. Embed the form on a page with the plugin's FormEmbed component.
  3. Open the page and click into the textarea: the caret starts on line 2, after the indentation.
  4. Submit without typing anything: the browser's required check passes.

Rendering FormEmbed.astro's textarea markup with the Astro Container API (astro 7.3.5) gives this content between <textarea ...> and </textarea>:

"\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t"
Environment
  • emdash version: 1.1.0
  • @emdash-cms/plugin-forms: 0.2.9 (also reproduced on 0.2.4)
  • astro: 7.3.5
  • Node.js version: 22.23.2
  • Runtime: Cloudflare Workers
  • OS: macOS
Screenshots
Unpatched textarea with its whitespace content selected: two lines of tabs are highlighted, while the patched textarea below is empty Submitting the untouched unpatched textarea passes the browser's required check with a value length of 16
Logs / error output

Dominant language
TypeScript
Stars
13.4k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
576

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emdash-cms/emdash

All issues in emdash-cms/emdash

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.