From bb8f16a2df0f2eaee039cc9ca4fde6ec37eb3d8d Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 3 Feb 2025 16:14:40 -0500 Subject: [PATCH] fix code field --- docs/pages/components/split-panel.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/pages/components/split-panel.md b/docs/pages/components/split-panel.md index 46a12debe..943f2c8cc 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.