Skip to content

Svelte docs: document defaultValue #1358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theetrain opened this issue May 23, 2025 · 1 comment
Open

Svelte docs: document defaultValue #1358

theetrain opened this issue May 23, 2025 · 1 comment

Comments

@theetrain
Copy link

theetrain commented May 23, 2025

Special element attributes defaultValue and defaultChecked (maybe there are others?) don't appear to be documented. I could see this being its own page, or an addendum to some existing pages.

I see these as special since although they've available through the DOM API, Svelte allows them to be set as attributes that work well with bind:value or assigning value to either a string or nullish value.

Applicable pages:

@hyunbinseo
Copy link
Contributor

I agree that a independent documentation is needed.

I just learned that these Svelte markups:

<input type="checkbox" defaultChecked />
<input type="checkbox" defaultChecked={true} />

are both server rendered as <input type="checkbox"/>, which is not what I expected.

Currently, these attributes are only mentioned in the bind: section and are not searchable.

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

No branches or pull requests

2 participants