Skip to content

Commit 4c94e2a

Browse files
authored
fix: Update default Modal heading element to h1 (#3048)
* fix: Update default Modal heading element to h1 * add section check
1 parent aecff13 commit 4c94e2a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/modal/__tests__/modal.browser-test.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ describe('SLDSModal: ', function () {
234234
modal = getModalNode(document.body);
235235
});
236236

237+
it('adds the default h1 heading element', () => {
238+
const header = modal.querySelector('section .slds-modal__header h1');
239+
expect(header).to.not.be.null;
240+
});
241+
237242
it('adds the footer', () => {
238243
const footer = modal.querySelector('.slds-modal__footer');
239244
expect(footer.className).to.include('slds-theme_default');

components/modal/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,15 +449,15 @@ class Modal extends React.Component {
449449
headerContent = (
450450
<div>
451451
{this.props.toast}
452-
<h2
452+
<h1
453453
className={classNames({
454454
'slds-text-heading_small': this.isPrompt(),
455455
'slds-text-heading_medium': !this.isPrompt(),
456456
})}
457457
id={`${this.getId()}-heading`}
458458
>
459459
{this.props.heading ? this.props.heading : this.props.title}
460-
</h2>
460+
</h1>
461461
{this.props.tagline ? (
462462
<p className="slds-m-top_x-small">{this.props.tagline}</p>
463463
) : null}

0 commit comments

Comments
 (0)