DEV: Add `@bodyClass` argument to `<DModal>` component (#22410)

This commit is contained in:
David Taylor 2023-07-04 10:26:46 +01:00 committed by GitHub
parent ee1dbd46c6
commit 999014e8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -76,7 +76,7 @@
</div>
{{/if}}
<div class="modal-body" tabindex="-1">
<div class={{concat-class "modal-body" @bodyClass}} tabindex="-1">
{{#if (has-block "body")}}
{{yield to="body"}}
{{else}}

View File

@ -72,4 +72,13 @@ module("Integration | Component | d-modal", function (hooks) {
closeModalCalled = false;
});
test("header and body classes", async function (assert) {
await render(
hbs`<DModal @inline={{true}} @bodyClass="my-body-class" @headerClass="my-header-class" @title="Hello world" />`
);
assert.dom(".d-modal .modal-header").hasClass("my-header-class");
assert.dom(".d-modal .modal-body").hasClass("my-body-class");
});
});