> For the complete documentation index, see [llms.txt](https://learn.squirrel365.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.squirrel365.io/squirrel-addon-documentation/squirrel-helper-library/javascript/events/onsetposition.md).

# onSetPosition

```typescript
onSetPosition(e){
  const position = e.detail.position;
}
```

Called when a setPosition event is received from Squirrel. The x and y coordinates of the component on the canvas is passed into this callback. If you need to get the position at any time you can call the [getPosition()](/squirrel-addon-documentation/squirrel-helper-library/javascript/methods/getposition.md) method,

The event is fired when ever the component's position is changed on the canvas.  This could be when the component is manually moved, or when the x / y property is updated via a spreadsheet binding or property change.

If you super the base class onSetPosition method then it will add debug logs to your output

<br>

<br>
