ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.67k stars 2.41k forks source link

fix(Popover): popover ref.current.show() invalid #6732

Open DaJianWu opened 3 months ago

DaJianWu commented 3 months ago

6731

github-actions[bot] commented 3 months ago

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6732.surge.sh

zombieJ commented 3 months ago

CI failed. Pls check

xiaoyao96 commented 3 months ago

在ref.current.show()前使用e.stopPropagation(); 就不会执行useClickAway的回调。

------------------ Original ------------------ From: wudajian @.> Date: Fri,Aug 30,2024 9:23 AM To: ant-design/ant-design-mobile @.> Cc: Leisure @.>, Comment @.> Subject: Re: [ant-design/ant-design-mobile] fix(Popover): popoverref.current.show() invalid (PR #6732)

@DaJianWu commented on this pull request.

In src/components/popover/popover.tsx: > @@ -196,6 +200,10 @@ export const Popover = forwardRef<PopoverRef, PopoverProps>((p, ref) => { useClickAway( () => { if (!props.trigger) return + if (stateRef.current.isClickShow) { + stateRef.current.isClickShow = false
没太理解 会导致stateRef.current.isClickShow为true的状态持续在Popover组件内 我在useClickAway把isClickShow改为false了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>