Skip to content

Commit

Permalink
fix(form-builder): pass boundary element to useClickOutside in popo…
Browse files Browse the repository at this point in the history
…vers (PTE)
  • Loading branch information
mariuslundgard committed Dec 16, 2021
1 parent 139aabf commit 6abecc7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ function Content(
width = 'small',
} = props
const {isTopLayer} = useLayer()
const {element: boundaryElement} = useBoundaryElement()

const handleChange = useCallback((patchEvent: PatchEvent): void => onChange(patchEvent, path), [
onChange,
Expand All @@ -165,7 +166,7 @@ function Content(
[handleClose]
)

useClickOutside(handleClose, [rootElement])
useClickOutside(handleClose, [rootElement], boundaryElement)

useEffect(() => {
window.addEventListener('keydown', handleKeyDown)
Expand Down

3 comments on commit 6abecc7

@vercel
Copy link

@vercel vercel bot commented on 6abecc7 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

studio-workshop – ./dev/workshop

studio-workshop-git-next.sanity.build
studio-workshop.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 6abecc7 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 6abecc7 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio-git-next.sanity.build
perf-studio.sanity.build

Please sign in to comment.