aarongustafson / form-required-checkboxes

Web component that enables requirement rules for checkbox groups
MIT License
4 stars 0 forks source link

demo issue #1

Open bkardell opened 2 months ago

bkardell commented 2 months ago

In checking out the demo I (accidentally) discovered that the demo at least doesn't seem to expect what I did. Effectively in the demo has

<form-required-checkboxes required="3" notice="Choose 3 options" error="Please be sure to pick only 3 items">

And I picked only 1 - this seems like a pretty common kind of error. To me, the error here was confusing. I suppose you could make the error say "please choose exactly 3 items". Or, alternatively, maybe maybe could make the error API handle more cases.

aarongustafson commented 1 month ago

I tried to provide a number of options for customizing the messages presented via attributes. If you have suggestions for ways the messaging could be improved upon, I’m open to them. One idea might be the ability to slot in details like this:

error="You have chosen {count} items. Please choose only {required} items."

Where "count" pipes through the total items currently chosen and "required" inserts the value of the required attribute. I also considered a "difference" option, but that gets a little hairier when it comes to translations for contextual things like "fewer" and "more."

bkardell commented 1 month ago

My main suggestion is to improve the messaging on the demo where 'only' doesn't always make sense

Screenshot 2024-07-17 at 8 25 14 AM
aarongustafson commented 1 month ago

Ok. So, just for clarity, is your issue that the "only" in that example could be viewed as confusing when you've picked less than 3 items?

bkardell commented 3 weeks ago

Sorry for the very delayed reply, but:....

yes.