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

fix: 修复弹窗嵌套弹窗观察动作执行逻辑错误 Close: #10200 #10213

Merged
merged 1 commit into from
May 13, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/amis/src/renderers/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ export default class Dialog extends React.Component<DialogProps> {
render(`action/${key}`, action, {
data: store.formData,
onAction: this.handleAction,
// 以免调用上层弹窗的 onActionSensor 方法
// 弹窗观察内部的动作执行,不需要观察到子弹窗里面去
// 所以这里传递了 undefined
onActionSensor: undefined,
key,
disabled: action.disabled || store.loading || !show
})
Expand Down Expand Up @@ -715,7 +719,8 @@ export default class Dialog extends React.Component<DialogProps> {
) : null}
{render('title', title, {
data: store.formData,
onAction: this.handleAction
onAction: this.handleAction,
onActionSensor: undefined
})}
</div>
) : showCloseButton !== false && !store.loading ? (
Expand All @@ -731,7 +736,8 @@ export default class Dialog extends React.Component<DialogProps> {
{header
? render('header', header, {
data: store.formData,
onAction: this.handleAction
onAction: this.handleAction,
onActionSensor: undefined
})
: null}

Expand Down
7 changes: 5 additions & 2 deletions packages/amis/src/renderers/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ export default class Drawer extends React.Component<DrawerProps> {
{actions.map((action, key) =>
render(`action/${key}`, action, {
onAction: this.handleAction,
onActionSensor: undefined,
data: store.formData,
key,
disabled: action.disabled || store.loading
Expand Down Expand Up @@ -684,7 +685,8 @@ export default class Drawer extends React.Component<DrawerProps> {
data: store.formData,
onConfirm: this.handleDrawerConfirm,
onClose: this.handleDrawerClose,
onAction: this.handleAction
onAction: this.handleAction,
onActionSensor: undefined
})}
</div>
) : null}
Expand All @@ -693,7 +695,8 @@ export default class Drawer extends React.Component<DrawerProps> {
data: store.formData,
onConfirm: this.handleDrawerConfirm,
onClose: this.handleDrawerClose,
onAction: this.handleAction
onAction: this.handleAction,
onActionSensor: undefined
})
: null}
</div>
Expand Down