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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shineout",
"version": "2.0.32-beta.4",
"version": "2.0.32-beta.5",
"description": "Shein 前端组件库",
"main": "./lib/index.js",
"module": "./es/index.js",
Expand Down
5 changes: 2 additions & 3 deletions site/pages/documentation/changelog/2.x.x.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# 更新日志

### 2.0.33
- 修复 `Form` 调用 `validateClear` 传入指定字段名时,若对应字段未注册校验器会导致报错的问题

### 2.0.32
- 修复 `Modal` 通过 `Modal.show` 等方法打开的弹窗,在 `onClose` 中调用 `Modal.closeAll` 时会触发无限递归导致栈溢出报错的问题
- 修复 `Form` 调用 `validateClear` 传入指定字段名时,若对应字段未注册校验器会导致报错的问题
- 修复 `Table` 使用 `treeExpandKeys` 展开树形行时,若数据中包含 DOM 引用等不可序列化字段会导致页面崩溃的问题
- 修复 `Grid` 组件动态生成的样式在微前端场景下被错误劫持导致样式失效的问题
- 修复 `Dropdown` 嵌套使用 `absolute` 时子级菜单项点击无法触发 onClick 的问题(Regression: since 2.0.29)
Expand Down
22 changes: 15 additions & 7 deletions src/Modal/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,22 @@ export const method = (type: Methods) => (option: Options) => {
return () => close(props)
}

let closingAll = false
export const closeAll = () => {
Object.keys(containers)
.filter(id => containers[id].props.from === 'method' && containers[id].visible)
.forEach(id => {
const { onClose, usePortal } = containers[id].props
if (onClose) onClose()
if (!usePortal) close(containers[id].props)
})
// 防止用户在 onClose 回调中再次调用 closeAll 造成无限递归
if (closingAll) return
closingAll = true
try {
Object.keys(containers)
.filter(id => containers[id].props.from === 'method' && containers[id].visible)
.forEach(id => {
const { onClose, usePortal } = containers[id].props
if (onClose) onClose()
if (!usePortal) close(containers[id].props)
})
} finally {
closingAll = false
}
}

ready(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as utils from './utils'

export default { utils, version: '2.0.32-beta.4' }
export default { utils, version: '2.0.32-beta.5' }
export { utils }
export { setLocale } from './locale'
export { color, style } from './utils/expose'
Expand Down
Loading