NbAutocomplete - Problem with disabling autocomplete input using FormControl
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior:
Cannot apply disabled
attribute on input using FormControl
I try to disable form control using form.disable()
or inputCtrl.disable()
and the input is still enabled. It looks like directive doesn’t take it into account while setting value and other attributes.
I also checked this behavior using nebular playground from repository and I still couldn’t set disabled attribute.
Expected behavior: When setting ‘disabled’ status on FormControl or Reactive Form autocomplete input should be disabled.
Steps to reproduce:
- Use reactive form autocomplete in template basing docs
- Set FormControl initial status to
field: { value: '', disabled: true }
or useformControl.disable()
orform.disable()
Related code:
// This doesn't work
this.inputFormControl = new FormControl({ value: '', disabled: true });
// doesn't work either
this.inputFormControl.disable();
// this returns `true` - model has information about control `disabled` state
console.log(this.inputFormControl.disabled)
Other information:
npm, node, OS, Browser
Node: v12.16.1
npm: 6.13.4
OS: Ubuntu 18.04.2 LTS
Browser: Chrome
Angular, Nebular
"@angular/animations": "~9.1.0",
"@angular/cdk": "^8.2.3",
"@angular/common": "~9.1.0",
"@angular/compiler": "~9.1.0",
"@angular/core": "~9.1.0",
"@angular/forms": "~9.1.0",
"@angular/platform-browser": "~9.1.0",
"@angular/platform-browser-dynamic": "~9.1.0",
"@angular/router": "~9.1.0",
"@nebular/auth": "^5.0.0",
"@nebular/bootstrap": "^5.0.0",
"@nebular/date-fns": "^5.0.0",
"@nebular/eva-icons": "^5.0.0",
"@nebular/theme": "^5.0.0",
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Angular Material's mat-autocomplete input is not getting ...
You should use formControl to set it, something like: this.formGroupName.controls['myControl'].disable().
Read more >Autocomplete | Angular Material
The autocomplete is a normal text input enhanced by a panel of suggested options. ... Let's assume you're using the formControl directive from...
Read more >can't bind to 'matautocomplete' since it isn't a known property ...
Angular 8 mat-autocomplete ERROR - 'matAutocomplete' since it isn't a known property ... You can use Input to pass true or false then...
Read more >Turn Off AutoComplete Input Angular - Code Handbook
How to turn autocomplete off in Angular forms? ... <input type="number" formControlName="age" class="form-control" placeholder="Age"> </div> ...
Read more >Angular Material as a base for reusable components - Medium
But …. what if we have been using it wrong ? I… ... https://material.angular.io/components/input/overview. HTML for Angular Material inputs
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1
Fixed via #2555, included in
7.0.0
+