top | item 41110217

(no title)

alex7734 | 1 year ago

But why spend so much time to make it worse?

    on_click() {
        if (last_one()) alert('You must keep at least one item selected.');
        else actually_toggle_it_off();
    }
Simple. Does not need fancy code. User immediately knows what he has to do, with no thinking required.

discuss

order

andrewla|1 year ago

Disabling the "accept" button and having that message seems far superior. With this, when you are trying to unselect something you don't want, you get an annoying popup that you may or may not read. It's such a minority case -- most users will intuit that they need to select something and will uncheck "English" and check "Espanol" and continue on with their lives never knowing how dangerously close they came to violating the semantics of the input.

As much as possible you should stay out of the users way and let them decide how to interact.