Skip to content

Commit

Permalink
[@mantine/core] FloatingIndicator: Fix incorrect resize observer logic (
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed May 8, 2024
1 parent d3bb581 commit b966327
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ export function useFloatingIndicator({

if (target) {
targetResizeObserver.current = new ResizeObserver(updatePositionWithoutAnimation);
targetResizeObserver.current.observe(target!);
parentResizeObserver.current = new ResizeObserver(updatePositionWithoutAnimation);
parentResizeObserver.current.observe(parent!);
targetResizeObserver.current.observe(target);

if (parent) {
parentResizeObserver.current = new ResizeObserver(updatePositionWithoutAnimation);
parentResizeObserver.current.observe(parent);
}

return () => {
targetResizeObserver.current?.disconnect();
Expand Down

0 comments on commit b966327

Please sign in to comment.