Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed modal content overflowed #9592

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/modal/__tests__/Modal.test.js
Expand Up @@ -44,4 +44,13 @@ describe('Modal', () => {
const wrapper = mount(<ModalTester footer={null} />);
expect(wrapper.render()).toMatchSnapshot();
});

it('render with very long word fill in title', () => {
const wrapper = mount(
<ModalTester
title="Modal very long title:1:abcdefghijklmnopqrstuvwxyz:it:is:so:long:maybe:over:mask:view"
/>
);
expect(wrapper.render()).toMatchSnapshot();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is not useful to test work break situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know what I should do for testing it, and I have offered a problem demo, ex:
Edit n3pk656j5p

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have tests for CSS right now.

});
79 changes: 79 additions & 0 deletions components/modal/__tests__/__snapshots__/Modal.test.js.snap
Expand Up @@ -68,6 +68,85 @@ exports[`Modal render correctly 1`] = `
</div>
`;

exports[`Modal render with very long word fill in title 1`] = `
<div>
<div />
<div>
<div
class="ant-modal-mask fade-appear"
/>
<div
aria-labelledby="rcDialogTitle2"
class="ant-modal-wrap "
role="dialog"
tabindex="-1"
>
<div
class="ant-modal zoom-appear"
role="document"
style="width: 520px;"
>
<div
class="ant-modal-content"
>
<button
aria-label="Close"
class="ant-modal-close"
>
<span
class="ant-modal-close-x"
/>
</button>
<div
class="ant-modal-header"
>
<div
class="ant-modal-title"
id="rcDialogTitle2"
>
Modal very long title:1:abcdefghijklmnopqrstuvwxyz:it:is:so:long:maybe:over:mask:view
</div>
</div>
<div
class="ant-modal-body"
>
Here is content of Modal
</div>
<div
class="ant-modal-footer"
>
<div>
<button
class="ant-btn"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
OK
</span>
</button>
</div>
</div>
</div>
<div
style="width: 0px; height: 0px; overflow: hidden;"
tabindex="0"
>
sentinel
</div>
</div>
</div>
</div>
</div>
`;

exports[`Modal render without footer 1`] = `
<div>
<div />
Expand Down
1 change: 1 addition & 0 deletions components/modal/style/modal.less
Expand Up @@ -91,6 +91,7 @@
padding: 24px;
font-size: @font-size-base;
line-height: @line-height-base;
word-wrap: break-word;
}

&-footer {
Expand Down