edmundhung / conform

A type-safe form validation library utilizing web fundamentals to progressively enhance HTML Forms with full support for server frameworks like Remix and Next.js.
https://conform.guide
MIT License
2.04k stars 105 forks source link

collection checkboxes not behaving correctly #774

Open lifeiscontent opened 2 months ago

lifeiscontent commented 2 months ago

Describe the bug and the expected behavior

I'm not sure how to reproduce this but between versions 1.1.5 and 1.2.1 I'm seeing situations where if I have a defaultValue of more than 1 items selected, and have several other options, conform only seems to render 1 item as checked in the form.

Conform version

v1.2.1

Steps to Reproduce the Bug or Issue

here's a video of the reproduction:

https://www.loom.com/share/be05ee2475cd40c6b4555469869aef34

What browsers are you seeing the problem on?

Chrome, Firefox, Microsoft Edge, Safari

Screenshots or Videos

No response

Additional context

No response

tacomanator commented 2 months ago

Same issue for me on 1.2.1. Was working as of 1.1.5.

Double checked that the fields.foo.initialValue has the expected values, but the corresponding checkboxes are not checked in the page. I noticed that they are checked for a brief moment when the page loads, but become unchecked shortly thereafter.

edmundhung commented 2 months ago

I can't watch the loom video without an account. Any chance you can share a simple repo? 😅 I will take a look later today to see if I can figure something out. Sorry for the trouble.

lifeiscontent commented 2 months ago

@edmundhung I think it might be because you're outside of the US, do you mind using a VPN? I can't reproduce it, otherwise I would have. I spent about 30 minutes trying to scope it down.

edmundhung commented 2 months ago

Looks like loom is complaining only when I have Cloudflare Warp on 🤔 Anyway, I figure out the issue. I will put up a PR with a pre-release for you to test it out.

edmundhung commented 2 months ago

I have put up a fix on #775. Can you give the pre-release a try and let me know if you run into any issues? Thanks.

lasseklovstad commented 2 months ago

I had the same issue and I tested the pre-relase and it worked for me 😄

edmundhung commented 2 months ago

I'm sorry for the trouble. I've concluded that it's best to revert the relevant changes, and I've just published v1.2.2.