Skip to content

Commit 3f1d378

Browse files
authored
fix: safari selection (#17)
1 parent fbcc429 commit 3f1d378

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

.changeset/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"access": "public",
1111
"baseBranch": "main",
1212
"updateInternalDependencies": "patch",
13-
"ignore": []
13+
"ignore": ["docs"]
1414
}

.changeset/polite-numbers-brush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"paneforge": patch
3+
---
4+
5+
fixed a bug where safari would select the panel when dragging a handle up

packages/paneforge/src/lib/components/pane-resizer.svelte

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
getResizeHandleElementsForGroup,
55
} from "$lib/internal/paneforge.js";
66
import type { ResizeHandler } from "$lib/internal/types.js";
7-
import { getCursorStyle, generateId, styleToString } from "$lib/internal/utils/index.js";
7+
import { generateId, getCursorStyle, styleToString } from "$lib/internal/utils/index.js";
88
import { onMount } from "svelte";
99
import { getCtx } from "./ctx.js";
1010
import { resizeHandleAction } from "./pane-resizer.js";
11-
import type { PaneResizerProps, PaneResizerAttributes } from "./types.js";
11+
import type { PaneResizerAttributes, PaneResizerProps } from "./types.js";
1212
1313
type $$Props = PaneResizerProps;
1414
@@ -93,8 +93,10 @@
9393
$: style =
9494
styleToString({
9595
cursor: getCursorStyle($direction),
96-
touchAction: "none",
97-
userSelect: "none",
96+
"touch-action": "none",
97+
"user-select": "none",
98+
"-webkit-user-select": "none",
99+
"-webkit-touch-callout": "none",
98100
}) + styleFromProps ?? "";
99101
100102
$: attrs = {
@@ -105,6 +107,8 @@
105107
"data-pane-resizer-id": resizeHandleId,
106108
"data-pane-resizer": "",
107109
} satisfies PaneResizerAttributes;
110+
111+
$: console.log(style);
108112
</script>
109113

110114
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
@@ -125,13 +129,15 @@
125129
on:blur={() => (isFocused = false)}
126130
on:focus={() => (isFocused = true)}
127131
on:mousedown={(e) => {
132+
e.preventDefault();
128133
startDragging(resizeHandleId, e);
129134
onDraggingChange?.(true);
130135
}}
131136
on:mouseup={stopDraggingAndBlur}
132137
on:touchcancel={stopDraggingAndBlur}
133138
on:touchend={stopDraggingAndBlur}
134139
on:touchstart={(e) => {
140+
e.preventDefault();
135141
startDragging(resizeHandleId, e);
136142
onDraggingChange?.(true);
137143
}}

pnpm-lock.yaml

+4-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sites/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"eslint": "^8.56.0",
4646
"eslint-config-prettier": "^9.1.0",
4747
"eslint-plugin-svelte": "^2.35.1",
48-
"mdsx": "^0.0.3",
48+
"mdsx": "^0.0.5",
4949
"phosphor-svelte": "^1.4.2",
5050
"postcss": "^8.4.35",
5151
"postcss-load-config": "^5.0.3",

0 commit comments

Comments
 (0)