mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:18:29 +08:00
commit
d36d04116b
@ -821,6 +821,7 @@ test('Renderer:Page handleAction actionType=drawer mergeData', async () => {
|
||||
);
|
||||
|
||||
fireEvent.click(getByText(/OpenDrawer/));
|
||||
await wait(600);
|
||||
expect(container).toMatchSnapshot();
|
||||
|
||||
fireEvent.click(getByText(/确认/));
|
||||
@ -1196,7 +1197,7 @@ test('Renderer:Page initApi reload by Drawer action', async () => {
|
||||
expect(container).toMatchSnapshot();
|
||||
|
||||
fireEvent.click(getByText(/OpenDialog/));
|
||||
await wait(400);
|
||||
await wait(500);
|
||||
|
||||
expect(container).toMatchSnapshot();
|
||||
fireEvent.click(getByText(/确认/));
|
||||
|
@ -218,9 +218,12 @@ export function HocStoreFactory(renderer: {
|
||||
// nextProps.data.__super !== props.data.__super) &&
|
||||
} else if (
|
||||
props.scope &&
|
||||
isObjectShallowModified(props.scope, prevProps.scope, false) &&
|
||||
props.data === props.store!.data &&
|
||||
(shouldSync === true || prevProps.data !== props.data)
|
||||
) {
|
||||
// 只有父级数据变动的时候才应该进来,
|
||||
// 目前看来这个 case 很少有情况下能进来
|
||||
store.initData(
|
||||
createObject(props.scope, {
|
||||
// ...nextProps.data,
|
||||
|
@ -605,8 +605,7 @@ export default class Dialog extends React.Component<DialogProps> {
|
||||
shouldSyncSuperStore: (store: IServiceStore, props: any, prevProps: any) =>
|
||||
(store.dialogOpen || props.show) &&
|
||||
(props.show !== prevProps.show ||
|
||||
isObjectShallowModified(prevProps.data, props.data) ||
|
||||
isObjectShallowModified(prevProps.data.__super, props.data.__super))
|
||||
isObjectShallowModified(prevProps.data, props.data))
|
||||
})
|
||||
export class DialogRenderer extends Dialog {
|
||||
static contextType = ScopedContext;
|
||||
|
@ -599,9 +599,15 @@ export default class Drawer extends React.Component<DrawerProps> {
|
||||
: null}
|
||||
</div>
|
||||
|
||||
<div className={cx('Drawer-body', bodyClassName)}>
|
||||
{body ? this.renderBody(body, 'body') : null}
|
||||
</div>
|
||||
{!store.entered ? (
|
||||
<div className={cx('Drawer-body', bodyClassName)}>
|
||||
<Spinner overlay show size="lg" />
|
||||
</div>
|
||||
) : body ? (
|
||||
<div className={cx('Drawer-body', bodyClassName)}>
|
||||
{this.renderBody(body, 'body')}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{this.renderFooter()}
|
||||
|
||||
@ -657,8 +663,7 @@ export default class Drawer extends React.Component<DrawerProps> {
|
||||
shouldSyncSuperStore: (store: IServiceStore, props: any, prevProps: any) =>
|
||||
(store.drawerOpen || props.show) &&
|
||||
(props.show !== prevProps.show ||
|
||||
isObjectShallowModified(prevProps.data, props.data) ||
|
||||
isObjectShallowModified(prevProps.data.__super, props.data.__super))
|
||||
isObjectShallowModified(prevProps.data, props.data))
|
||||
})
|
||||
export class DrawerRenderer extends Drawer {
|
||||
static contextType = ScopedContext;
|
||||
|
Loading…
Reference in New Issue
Block a user