auto-complete
auto-complete copied to clipboard
how to disable or make readonly ng2-auto-complete
IMPORTANT Please be specific with an example. An issue with no example may be closed.
Steps to reproduce and a minimal demo
- What steps should we try in your demo to see the problem?
- Plunker example(REQUIRED)
- If you cannot reproduce an issue with a plunker example, it's your environmental issue
Current behavior
Expected/desired behavior
Other information
@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 ?