By default, the module returns an error message when user selects more than the maximum number of values (based on the field settings). The behavior makes sense for multiple values but not so much for single selection (it's awkward to uncheck just one value before selection).
Instead of saying "Please select no more than 1 values", it should just replace the old value with the new one. E.g. mimic the file selection behavior.
I've included a patch for review.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entityreference_view_widget-better_single_selection-2392609-1.patch | 1.61 KB | abrlam |
| #1 | entityreference_view_widget-better_single_selection-2392609-0.patch | 1.58 KB | abrlam |
Comments
Comment #1
abrlam commentedComment #2
abrlam commentedminor correction
Comment #3
seycom commented#2 works great for me, thank you!
Comment #4
TheMGamer commented#2 works for me also! Thank you
Comment #6
jsacksick commentedThanks for the patch, I removed extra whitespaces and I committed a slightly different patch!