admin管理员组文章数量:1291315
I'm using primeNg multiselect in Angular Project
If I have a dropdown of items and I set selection limit to 1, all items get disabled if the user selects an item of the dropdown.
But if the user wants to select another item, they need to deselect the already selected item first in order to be able to select another item.
Is there a way to prevent disabling the options when the selecting limit is reached so if the user selects and item, they could change the selected item with simple click, not needing to deselect the already selected item first.
Tried Primeng doco, no answer found.
Code to reproduce with one possible selection :
<p-multiselect [options]="cities" [(ngModel)]="selectedCities" optionLabel="name" placeholder="Select Cities" [maxSelectedLabels]="3" styleClass="w-full md:w-80" [selectionLimit]=1/>
and in the ts file
cities = {name: 'New York', code: 'NY'},
{name: 'Rome', code: 'RM'},
{name: 'London', code: 'LDN'},
{name: 'Istanbul', code: 'IST'},
{name: 'Paris', code: 'PRS'}
本文标签: angularprimeNg multiselect should not disable options if selection limit is reachedStack Overflow
版权声明:本文标题:angular - primeNg multiselect should not disable options if selection limit is reached - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741530896a2383746.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论