naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

Limit the number of selections for `NSelect`

Open KeroZhai opened this issue 2 years ago • 2 comments

The problem this function solves

For now, users can select as many as possible options in NSelect, but sometimes, we want to limit the number of selections.

Expected API

Provide a prop max, just like NUpload.

KeroZhai avatar Sep 14 '22 07:09 KeroZhai

You can limit it by drop value in on-update:value

07akioni avatar Sep 14 '22 15:09 07akioni

Yeah, it should work, but it would be better if there were some visual effects. For example, options (except the selected ones) will be automatically disabled once the limit is reached, so that users can immediately know that they cannot select more options.

KeroZhai avatar Sep 15 '22 02:09 KeroZhai

I agree with KeroZhai

yaojunmiss77 avatar Aug 24 '23 07:08 yaojunmiss77

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem

jahnli avatar Mar 12 '24 13:03 jahnli