File tree 4 files changed +13
-2
lines changed
4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ ng_module(
18
18
deps = [
19
19
"//src/lib/core" ,
20
20
"//src/cdk/coercion" ,
21
+ "//src/cdk/observers" ,
21
22
"//src/cdk/platform" ,
22
23
],
23
24
tsconfig = "//src/lib:tsconfig-build.json" ,
Original file line number Diff line number Diff line change 8
8
9
9
import { CommonModule } from '@angular/common' ;
10
10
import { NgModule } from '@angular/core' ;
11
+ import { ObserversModule } from '@angular/cdk/observers' ;
11
12
import { MatError } from './error' ;
12
13
import { MatFormField } from './form-field' ;
13
14
import { MatHint } from './hint' ;
@@ -27,7 +28,10 @@ import {MatSuffix} from './suffix';
27
28
MatPrefix ,
28
29
MatSuffix ,
29
30
] ,
30
- imports : [ CommonModule ] ,
31
+ imports : [
32
+ CommonModule ,
33
+ ObserversModule ,
34
+ ] ,
31
35
exports : [
32
36
MatError ,
33
37
MatFormField ,
Original file line number Diff line number Diff line change 27
27
<!-- We add aria-owns as a workaround for an issue in JAWS & NVDA where the label isn't
28
28
read if it comes before the control in the DOM. -->
29
29
< label class ="mat-form-field-label "
30
+ (cdkObserveContent) ="updateOutlineGap() "
30
31
[id] ="_labelId "
31
32
[attr.for] ="_control.id "
32
33
[attr.aria-owns] ="_control.id "
Original file line number Diff line number Diff line change @@ -481,7 +481,12 @@ export class MatFormField extends _MatFormFieldMixinBase
481
481
this . _outlineGapWidth = 0 ;
482
482
}
483
483
this . _initialGapCalculated = true ;
484
- this . _changeDetectorRef . markForCheck ( ) ;
484
+ // @breaking -change 7.0.0 Remove this check and else block once _ngZone is required.
485
+ if ( this . _ngZone ) {
486
+ this . _ngZone . run ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
487
+ } else {
488
+ this . _changeDetectorRef . markForCheck ( ) ;
489
+ }
485
490
}
486
491
487
492
/** Gets the start end of the rect considering the current directionality. */
You can’t perform that action at this time.
0 commit comments