Open tgelu opened 1 year ago
What are you using updatePosition for?
In two places:
updatePosition
in a useLayoutEffect
in such casesupdatePosition
(it may have something to do with press handler invocation timing)But I don't think we should focus too much on my use case. I guess it's only "coincidental" that I personally need updatePosition
. I think the fact that updatePosition
is returned from useOverlayPosition
and the higher-level hook usePopover
is meant to replace most, if not all, usages of useOverlayPosition
it follows that updatePosition
should also be returned from usePopover
. Otherwise it is bound to still keep people on the lower-level hooks for various reasons (which may differ than the two examples above) and that defeats the purpose of usePopover
for at least a chunk of react-aria users.
@devongovett I could also really use this feature. We have a context menu which is tied to a field, and our designers want to be able to keep the menu open during a resize event. edit - triggering window resize event does the update but seems like an odd workaround @snowystinger cc
๐ Bug Report
usePopover
is meant to replace the low-leveruseOverlayPosition
but because of a missing return value it can't in some cases.๐ค Expected Behavior
updatePosition
should be returned fromusePopover
.๐ฏ Current Behavior
updatePosition
fromuseOverlayPosition
which is useful for many scenarios, is not returned byusePopover
.๐ Possible Solution
There's an old, open PR.
๐ฆ Context
Was looking at replacing our usage of low-level hooks which have been replaced by
usePopover
.๐ป Code Sample
N/A
๐ Your Environment
N/A
๐งข Your Company/Team
N/A
๐ท Tracking Issue (optional)
N/A