Skip to content

Commit

Permalink
Revert "fix(antd): fix form item overflow tooltip abnormal show when …
Browse files Browse the repository at this point in the history
…containe…" (#4265)

This reverts commit 30167e1.
  • Loading branch information
janryWang authored Jan 22, 2025
1 parent a0f3169 commit 9616194
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions packages/antd/src/form-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function useOverflow<
const labelCol = JSON.stringify(layout.labelCol)

useEffect(() => {
const checkOverflow = () => {
requestAnimationFrame(() => {
if (containerRef.current && contentRef.current) {
const contentWidth = contentRef.current.getBoundingClientRect().width
const containerWidth =
Expand All @@ -118,18 +118,7 @@ function useOverflow<
if (overflow) setOverflow(false)
}
}
}

requestAnimationFrame(checkOverflow)

const resizeObserver = new ResizeObserver(() =>
requestAnimationFrame(checkOverflow)
)
resizeObserver.observe(containerRef.current)
resizeObserver.observe(contentRef.current)
return () => {
resizeObserver.disconnect()
}
})
}, [labelCol])

return {
Expand Down

0 comments on commit 9616194

Please sign in to comment.