Open mareksed opened 1 week ago
I looked into sources and sort of did quick fix, we can observe position change of the trigger
In flyoutReducer, I have changed
case "position":
if (state.status !== "rendered" && state.status !== "visible") return state;
return {
...state,
status: state.status === "visible" ? "visible" : "positioned",
position: action.payload.position,
styles: { ...defaultStyles, ...action.payload.styles },
};
And in FlyoutControlled
const MObserver = React.useRef(
new MutationObserver((mutations) => {
if (mutations.length) {
updatePosition();
}
})
);
React.useEffect(() => {
if (triggerElRef.current) {
MObserver.current.observe(triggerElRef.current, { attributes: true });
}
}, [updatePosition, triggerElRef]);
Describe the bug When position of Popover.Trigger is changed with
transform: translate()
, while popover content is open the position is not updated.To Reproduce https://codesandbox.io/p/sandbox/reshaped-toolbar-zvqqmw?file=%2Fsrc%2FApp.js%3A10%2C31
Expected behavior Popover.Contents position is updated according to position change
Screenshots
Environment (please complete the following information):