Currently, I am trying to change the default position that a widget deploys in from the widget controller. Normally, a widget will appear above the controller (controller positioned at the bottom of the screen). I would like my widget to appear in the top left. I've written this code, which definitely does not seem to be the intended way, and does not quite work:
export default function (props: AllWidgetProps<IMConfig>) {
useEffect(() => {
const elements = document.querySelectorAll('[aria-label="'+props.label+'"]');
elements[1].style.transform = 'translate(0px,0px)'
}, [])
...
}
This code does position the widget, but when repositioned with the cursor (drag/drop), the widget snaps back to the default position (above the widget controller). Additionally, the only way I could seem to access the widget itself (rather than the controller icon) was through its aria label, which is not ideal. It seems to be something about manipulating the CSS of a Popper element directly creating the issue?
Any help would be much appreciated, thank you!