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

[BUG] 通过 actionRef 调用开关时应该强制执行 #18

Closed
Wxh16144 opened this issue Mar 6, 2024 · 2 comments · Fixed by #19
Closed

[BUG] 通过 actionRef 调用开关时应该强制执行 #18

Wxh16144 opened this issue Mar 6, 2024 · 2 comments · Fixed by #19
Labels

Comments

@Wxh16144
Copy link
Owner

Wxh16144 commented Mar 6, 2024

不确定是不是 break change

import { Button } from 'antd';
import { Drawer } from 'easy-antd-modal';

function Content({ enhancedAction }: any) {
  return (
    <>
      <h1>I ❤️ antd</h1>
      <Button onClick={() => enhancedAction?.close()}>Close</Button>
    </>
  );
}

export default () => (
  <Drawer open trigger={<Button type="primary">Open Drawer</Button>}>
    <Content />
  </Drawer>
);

上述代码,我点击 <Content /> 中的 close 按钮不会讲抽屉关闭,因为我下面 Drawer 使用了受控形式,所以 actions Ref 没啥作用了。 希望可加上

@Wxh16144 Wxh16144 changed the title [BUG] 通过 actioc [BUG] 通过 actionRef 调用开关时应该强制执行 Mar 6, 2024
Copy link

github-actions bot commented Mar 6, 2024

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Wxh16144
Copy link
Owner Author

Wxh16144 commented Mar 6, 2024

原始需求是业务代码遇到的,但是强制关闭可能会和用户受控冲突,综合考虑了一下,还是在里面调用 close 的时候选择性的是否触发回调。1.6.0 完成了此事,并且做了一些其他的更新~ FAQ-内部通过 enhancedAction.close() 关闭不执行 onClean/onClose 方法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant