File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
projects/material/src/lib/mat-dropzone Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ export class MatDropzone
112
112
private _placeholder = '' ;
113
113
114
114
@Input ( )
115
- @HostBinding ( 'attr.aria-required' )
116
115
get required ( ) : boolean {
117
116
const controlRequired = this . ngControl ?. control ?. hasValidator ( Validators . required ) ;
118
117
return this . _required || controlRequired || false ;
@@ -140,6 +139,13 @@ export class MatDropzone
140
139
return this . empty && this . required ? null : this . errorState ;
141
140
}
142
141
142
+ @HostBinding ( 'attr.aria-required' )
143
+ get ariaRequired ( ) {
144
+ // Accessibility guidelines say that the attribute should be omitted when false,
145
+ // so we return null instead of false to remove it from the DOM.
146
+ return this . required || null ;
147
+ }
148
+
143
149
ngAfterContentInit ( ) {
144
150
super . ngAfterContentInit ( ) ;
145
151
You can’t perform that action at this time.
0 commit comments