Skip to content

Commit

Permalink
fix code field
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Feb 3, 2025
1 parent a7aadc9 commit bb8f16a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/pages/components/split-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ Or, if you want to snap the panel to every `100px` interval, as well as at 50% o
You can also implement a custom snap function which controls the snapping manually. To do this, you need to acquire a reference to the element in Javascript and set the `snap` property. For example, if you want to snap the divider to either `100px` from the left or `100px` from the right, you can set the `snap` property to a function encoding that logic.

```js
panel.snap = ({ pos, size }) => (pos < size / 2) ? 100 : (size - 100)
panel.snap = ({ pos, size }) => (pos < size / 2 ? 100 : size - 100);
```

Note that the `snap-threshold` property will not automatically be applied if `snap` is set to a function. Instead, the function itself must handle applying the threshold if desired, and is passed a `snapThreshold` member with its parameters.

Expand Down

0 comments on commit bb8f16a

Please sign in to comment.