diff --git a/docs/pages/components/split-panel.md b/docs/pages/components/split-panel.md index 46a12deb..943f2c8c 100644 --- a/docs/pages/components/split-panel.md +++ b/docs/pages/components/split-panel.md @@ -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.