session-resume icon indicating copy to clipboard operation
session-resume copied to clipboard

Add support for checkboxes and radio buttons

Open helen opened this issue 3 years ago • 1 comments

Noticed while adding some requested form support that inputs with a checked state are not accounted for, as they are dropped in the field.value !== field.defaultValue check. This adds support for them! And adds checkboxes to the test. I'm not sure this is the world's most elegant approach, but I think it's easy to understand and doesn't introduce a ton of logic.

Also included is an example/test page that I made to check that this wasn't a bug caused by something else in the bigger stack. The page has a button to set the sessionStorage, as I found it difficult to debug otherwise, but not a submit button. Happy to add a submit button :)

helen avatar Mar 03 '22 01:03 helen

Updated the PR to account for default checked checkboxes that get unchecked, along with a test for it. Hoping this is good to go so I can also move the work along on the actual form implementation side 🤞

helen avatar Mar 10 '22 02:03 helen

@seanpdoyle the changes make sense, however there are currently several failing tests on this branch. Can you please have a look? Thanks!

theinterned avatar Feb 06 '24 22:02 theinterned

UPDATE: @seanpdoyle here's a PR against this branch that fixes the tests https://github.com/helen/session-resume/pull/1

theinterned avatar Feb 06 '24 22:02 theinterned

🚀 This has shipped in v0.5.0

  • https://www.npmjs.com/package/@github/session-resume/v/0.5.0
  • https://github.com/github/session-resume/releases/tag/v0.5.0

theinterned avatar Feb 08 '24 20:02 theinterned