Skip to content

Conversation

@sa-mm
Copy link
Contributor

@sa-mm sa-mm commented Sep 10, 2025

The use case is to support checkboxes outside the <.form /> element. One needs the form attribute on the shadow input. Otherwise, you end up with inconsistent behavior.

<.input type="checkbox" form={@form.id} field={@form[:active]} />
<.form for={@form} id={@form.id}></.form>

We've been using this in production for a few months without issue. I'm happy to make adjustments if there are concerns about passing all of rest to that input.

@SteffenDE
Copy link
Contributor

Let's only pass form={@rest[:form] instead of all of @rest?

@sa-mm sa-mm force-pushed the checkbox-input-form-attribute branch from 8a1d68e to d4cc82f Compare September 29, 2025 04:17
@sa-mm
Copy link
Contributor Author

sa-mm commented Sep 29, 2025

Let's only pass form={@rest[:form] instead of all of @rest?

Sounds good. I pushed up the change.

@chrismccord chrismccord merged commit 145f718 into phoenixframework:main Sep 30, 2025
@chrismccord
Copy link
Member

❤️❤️❤️🐥🔥

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.

3 participants