ng2-ui / auto-complete

Angular Auto Complete component and directive
http://ng2-ui.github.io/auto-complete/
MIT License
280 stars 124 forks source link

how to disable or make readonly ng2-auto-complete #227

Closed krishna139 closed 1 month ago

krishna139 commented 7 years ago

IMPORTANT Please be specific with an example. An issue with no example may be closed.

Steps to reproduce and a minimal demo

Current behavior

Expected/desired behavior

Other information

bisonfoutu commented 7 years ago

@krishna139 you can disable it simply by setting the [disabled] property like so:

<input auto-complete [disabled]="myCondition" />

You can do the same thing with [readonly], but it will not prevent the list from displaying on click.

@allenhwkim it would be nice to have a way to disable the list when in readonly mode. I know it is currently a feature to keep the list in readonly mode to enable choosing a value without allowing a manual input. In my case, I would like to set readonly mode to be able to keep the value in my form (as the disabled state removes the input from form values), but also to stop showing the list to prevent the user from changing the value. Or is there something I missed ?

almothafar commented 1 month ago

This issue is stale. Please consider opening a new issue with details for the latest version if you are still facing the same issue or need improvement.

Closing it.