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(popup): popup useMutationObservable watch #text node problem #3091

Merged
Merged
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
4 changes: 2 additions & 2 deletions src/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ const Popup = forwardRef<PopupRef, PopupProps>((originalProps, ref) => {

const updateTimeRef = useRef(null);
// 监听 trigger 节点或内容变化动态更新 popup 定位
useMutationObserver(getRefDom(triggerRef), ([mutation]) => {
const isDisplayNone = getCssVarsValue('display', mutation.target as HTMLElement) === 'none';
useMutationObserver(getRefDom(triggerRef), () => {
const isDisplayNone = getCssVarsValue('display', getRefDom(triggerRef)) === 'none';
if (visible && !isDisplayNone) {
clearTimeout(updateTimeRef.current);
updateTimeRef.current = setTimeout(() => popperRef.current?.update?.(), 0);
Expand Down
Loading