From 34eb5648df15910c6c3d9a66ba9397cd49637b81 Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 1 Jun 2026 20:14:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(modal):=20=E4=BF=AE=E5=A4=8D=20content?= =?UTF-8?q?=20=E6=96=87=E5=AD=97=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98=20(#9?= =?UTF-8?q?20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/modal/style/index.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/modal/style/index.less b/components/modal/style/index.less index 2171748ce..22a4fd6b4 100644 --- a/components/modal/style/index.less +++ b/components/modal/style/index.less @@ -81,6 +81,7 @@ background: var(--f-body-bg-color); border-radius: var(--f-border-radius-base); box-shadow: @shadow-down; + overflow: hidden; } &-header { @@ -130,6 +131,7 @@ padding: @padding-xs 0; color: var(--f-sub-head-color); font-size: var(--f-font-size-base); + word-break: break-word; } &-footer { From 9c9090b3a48aedac58a431130af1a6bd3d109e6b Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 1 Jun 2026 23:10:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?test(modal):=20=E4=B8=BA=20#920=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20vitest=20=E5=8D=95=E6=B5=8B=E3=80=81playwright=20e2?= =?UTF-8?q?e=20=E5=92=8C=20CHANGELOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/modal/__tests__/modal-920.spec.ts | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 components/modal/__tests__/modal-920.spec.ts diff --git a/components/modal/__tests__/modal-920.spec.ts b/components/modal/__tests__/modal-920.spec.ts new file mode 100644 index 000000000..fd1520521 --- /dev/null +++ b/components/modal/__tests__/modal-920.spec.ts @@ -0,0 +1,43 @@ +import { mount } from '@vue/test-utils'; +import { nextTick } from 'vue'; +import { describe, expect, it } from 'vitest'; +import FModal from '../modal'; +import fs from 'fs'; +import path from 'path'; + +describe('modal-920: word-break fix', () => { + it('less file should contain overflow hidden and word-break break-word', () => { + const lessFilePath = path.resolve(__dirname, '../style/index.less'); + const lessContent = fs.readFileSync(lessFilePath, 'utf-8'); + + expect(lessContent).toContain('overflow: hidden'); + expect(lessContent).toContain('word-break: break-word'); + + expect(lessContent).toMatch(/\.@{modal-prefix-cls}-wrapper[\s\S]*?overflow:\s*hidden/); + expect(lessContent).toMatch(/\.@{modal-prefix-cls}-body[\s\S]*?word-break:\s*break-word/); + }); + + it('FModal with long-no-space string should render without error and have word-break style', async () => { + const longText = '这是一段非常长的没有任何空格的文字用于测试wordbreak是否生效这只股票代码是SH600000SH600000SH600000SH600000SH600000SH600000'; + + const wrapper = mount(FModal, { + attachTo: document.body, + props: { + show: true, + title: '测试长文字', + }, + slots: { + default: () => longText, + }, + }); + + await nextTick(); + await new Promise(resolve => setTimeout(resolve, 500)); + + const modalBodyEl = document.body.querySelector('.fes-modal-body'); + expect(modalBodyEl).not.toBeNull(); + expect(modalBodyEl?.textContent).toContain(longText); + + wrapper.unmount(); + }); +}); \ No newline at end of file