Skip to content

Commit ee5a261

Browse files
committed
fix(material/dialog): dialog name not read by sr on mac chrome & firefox
Cleans up fix for Angular Component Dialog component's fix to update the dialog aria-label if the user's OS is a mac since mac using a chrome or firefox browser the screenreader does NOT read the dialog name if the value is portrayed by aria-labelledby or aria-describedby. Cleaned up console logs and unused attributes. Fixes b/274674581
1 parent a3ba48b commit ee5a261

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/material/dialog/dialog-container.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ export class MatDialogContainer
145145
} else if (!os && /linux/.test(userAgent)) {
146146
os = 'linux';
147147
}
148-
console.log('userAgent:');
149-
console.log(userAgent);
150-
console.log(`os:`);
151-
console.log(os);
152148
// const platform = window.navigator.userAgent.platform
153149
return os;
154150
};
@@ -159,8 +155,6 @@ export class MatDialogContainer
159155
// or ariaDescribedBy values are applied to the dialog config
160156
const ariaLabelledByRefId = this._ariaLabelledByQueue[0];
161157
const ariaDescribedByRefId = this._ariaDescribedByQueue[0];
162-
console.log(`ariaLabelledByRefId: ${ariaLabelledByRefId}`);
163-
console.log(`ariaDescribedByRefId: ${ariaDescribedByRefId}`);
164158
// Get Element to get name/title from if ariaLabelledBy or ariaDescribedBy
165159
const dialogNameElement =
166160
document.getElementById(ariaLabelledByRefId) || document.getElementById(ariaDescribedByRefId);
@@ -171,8 +165,6 @@ export class MatDialogContainer
171165
: // : Otherwise prioritize use of ariaLabel
172166
this._config.ariaLabel || dialogNameElement?.innerText || dialogNameElement?.ariaLabel;
173167
this._config.ariaLabel = dialogNameInnerText || 'Dialog Modal';
174-
console.log(`getDialogName this.config.ariaLabel: `);
175-
console.log(this._config.ariaLabel);
176168
return this._config.ariaLabel;
177169
};
178170

src/material/dialog/dialog-content-directives.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ let dialogElementUid = 0;
3434
host: {
3535
'(click)': '_onButtonClick($event)',
3636
'[attr.aria-label]': 'ariaLabel || null',
37-
'[attr.aria-labelledby]': 'ariaLabelledBy || null',
38-
'[attr.aria-describedby]': 'ariaDescribedBy || null',
3937
'[attr.type]': 'type',
4038
},
4139
})

0 commit comments

Comments
 (0)