Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/drawer/before-close.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ test('拦截弹窗关闭', async ({ page }) => {
await page.goto('drawer#before-close')

const drawer = page.locator('.tiny-drawer__main')
const message = page.locator('.tiny-modal.type__message')
const message = page.locator('.tiny-modal__text')

await page.getByRole('button', { name: '点击展开 Drawer' }).click()
await expect(drawer).toBeVisible()

// 点击关闭按钮
await page.getByRole('button', { name: 'Close' }).click()
await expect(message.nth(1)).toContainText('close')
await expect(message).toContainText('close')
await expect(drawer).toBeVisible()

// 点击遮罩层
Expand Down
2 changes: 1 addition & 1 deletion packages/renderless/src/drawer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const computedHeight =

export const close =
({ api }: { api: IDrawerApi }) =>
(force = false) => {
(force = true) => {
api.handleClose('close', typeof force === 'boolean' ? force : false)
}

Expand Down
Loading