This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Commit a4507d6
fix(select): evaluate md-input-has-value on next tick (#11572)
this needs to happen after $render which is now evaluated on next tick
Fixes #11571
<!--
Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed.
-->
## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [ ] Docs have been added, updated, or were not required
## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. -->
Currently select labels are mashed into the values of a multi-selector.
This is the result of 97e2d00
Now multi-selectors $render is delayed to fix an incompatibility with forms.
Issue Number: #11571
## What is the new behavior?
Now the label is in the correct place.
To fix this I've updated the method that evaluates whether the select container should add the md-input-has-value class to also happen after $mdUtil.nextTick. This allows the class evaluation to happen in sync with the $render functionality.
After adding a $timeout.flush() to related tests to simulate the nextTick all tests passed.
A test to prove this fix was also added to prevent future regressions.
## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->
## Other information
N/A1 parent a49043d commit a4507d6
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
518 | 521 | | |
519 | 522 | | |
520 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| 341 | + | |
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
| |||
1010 | 1013 | | |
1011 | 1014 | | |
1012 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1013 | 1022 | | |
1014 | 1023 | | |
1015 | 1024 | | |
| |||
1251 | 1260 | | |
1252 | 1261 | | |
1253 | 1262 | | |
1254 | | - | |
| 1263 | + | |
1255 | 1264 | | |
1256 | 1265 | | |
1257 | 1266 | | |
| |||
1489 | 1498 | | |
1490 | 1499 | | |
1491 | 1500 | | |
| 1501 | + | |
1492 | 1502 | | |
1493 | 1503 | | |
1494 | 1504 | | |
| |||
0 commit comments