Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The `disabled` attribute does not work on a top level form which is an array

See original GitHub issue

Trying to get the top level form disabled in the following case (where currentStateRotors is an array):

  *ngIf="(currentStateRotors$ | async) as currentStateRotors"

The disabled property is not taken into account.

It should loop over the array and disable all the controls from the array.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

areijngoudtcommented, Nov 22, 2019

We’ve noticed the same behaviour when FormArray’s are in SubForms. When initially [disable]="true", normal FormControls get disabled but FormControls that are part of FormArrays don’t get disabled.

maxime1992commented, Dec 19, 2019

works like a charm

Glad to hear that 👍 !

when the form is set to disabled (using the [disabled] input property), the formGroup becomes dirty

Sounds like a bug @areijngoudt can you create a new issue please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

php - How to set the disabled attribute as ... - Stack Overflow
I intend to set the disabled attribute as "disabled" in the first option of both selects. This way the first options will be...
Read more >
How to set the disabled or readonly attribute of a CCK field
Here's a code snippet that you can use to set the disabled attribute of a CCK field. First, you need to create a...
Read more >
HTML attribute: disabled - HTML: HyperText Markup Language
The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can ...
Read more >
HTML | disabled Attribute - GeeksforGeeks
The disabled attribute in HTML indicates whether the element is disabled or not. If this attribute is set, the element is disabled.
Read more >
FormControlName - Angular
Syncs a FormControl in an existing FormGroup to a form control element by name ... Returns an array that represents the path from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found