Commit df6e731
committed
fix(select): handle corner case of adding options via a custom directive
Under specific circumstances (e.g. adding options via a directive with `replace: true` and a
structural directive in its template), an error occurred when trying to call `hasAttribute()` on a
comment node (which doesn't support that method).
This commit fixes it by filtering out comment nodes in the `addOption()` method.
Fixes angular#13874
Closes angular#138781 parent af9c2d7 commit df6e731
2 files changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
455 | | - | |
456 | 458 | | |
457 | 459 | | |
458 | 460 | | |
| |||
466 | 468 | | |
467 | 469 | | |
468 | 470 | | |
469 | | - | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| |||
313 | 324 | | |
314 | 325 | | |
315 | 326 | | |
316 | | - | |
| 327 | + | |
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
| |||
340 | 351 | | |
341 | 352 | | |
342 | 353 | | |
343 | | - | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
611 | 622 | | |
612 | 623 | | |
613 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
614 | 639 | | |
615 | 640 | | |
616 | 641 | | |
| |||
0 commit comments