Setting the window position is not permanent.
How to reproduce:
Chaging window stage also reverts previous position
Hi Hubert,
Thank you for contacting us.
The internal state of the Window will update when an event of the Window is fired and since the position is change manually outside of the Window events, the internal state will not update. However, you can manually update the state by using the Window ref and its setState method:
const windowRef = React.useRef(null);
const moveToCorner = () => {
setPosition({ ...position, top: 70, left: 30 });
windowRef.current.setState({ top: 70, left: 30 });
};
return (
<div>
<Button onClick={handleShowWindow}>Show/Hide</Button>
<Button onClick={moveToCorner}>move to corner</Button>
{opened && (
<Window
ref={windowRef}
Nevertheless, we will consider handling this internally when the position values are changed externally.
Regards,
Konstantin Dikov
Progress Telerik
Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024