.nodedc-split-pane__separator:not(:focus-visible)::before {
+.nodedc-split-pane[data-separator-appearance="invisible"] > .nodedc-split-pane__separator:not(:focus-visible)::before,
+.nodedc-split-pane[data-separator-appearance="invisible"] > .nodedc-split-pane__separator[data-pointer-focus]::before,
+.nodedc-split-pane[data-separator-appearance="invisible"][data-dragging="true"] > .nodedc-split-pane__separator::before {
background: transparent;
box-shadow: none;
}
diff --git a/packages/ui-react/src/SplitPane.tsx b/packages/ui-react/src/SplitPane.tsx
index db234e9..61213bd 100644
--- a/packages/ui-react/src/SplitPane.tsx
+++ b/packages/ui-react/src/SplitPane.tsx
@@ -57,6 +57,7 @@ export function SplitPane({
const rootRef = useRef(null);
const activePointerIdRef = useRef(null);
const [dragging, setDragging] = useState(false);
+ const [pointerFocus, setPointerFocus] = useState(false);
const limits = normalizedLimits(minPrimarySize, minSecondarySize);
const size = clamp(Number.isFinite(primarySize) ? primarySize : 50, limits.minimum, limits.maximum);
const keyboardIncrement = Number.isFinite(step) && step > 0 ? step : 2;
@@ -74,6 +75,7 @@ export function SplitPane({
};
const handleKeyDown = (event: KeyboardEvent) => {
+ setPointerFocus(false);
const multiplier = event.shiftKey ? 5 : 1;
const decrement = orientation === "vertical" ? "ArrowLeft" : "ArrowUp";
const increment = orientation === "vertical" ? "ArrowRight" : "ArrowDown";
@@ -119,10 +121,13 @@ export function SplitPane({
aria-valuemax={Math.round(limits.maximum)}
aria-valuenow={Math.round(size)}
aria-valuetext={`${Math.round(size)}% / ${Math.round(100 - size)}%`}
+ data-pointer-focus={pointerFocus || undefined}
+ onBlur={() => setPointerFocus(false)}
onKeyDown={handleKeyDown}
onPointerDown={(event) => {
if (event.button !== 0) return;
- event.currentTarget.focus();
+ setPointerFocus(true);
+ event.currentTarget.focus({ preventScroll: true });
activePointerIdRef.current = event.pointerId;
event.currentTarget.setPointerCapture(event.pointerId);
setDragging(true);
diff --git a/registry/components.json b/registry/components.json
index 1bc03b5..4c3fc39 100644
--- a/registry/components.json
+++ b/registry/components.json
@@ -547,7 +547,7 @@
"behavior": [
"controlled percentage",
"optional resizable separator",
- "line or invisible separator appearance with retained keyboard focus",
+ "line or invisible separator appearance with retained keyboard focus; pointer resize never paints the invisible divider",
"pointer capture drag",
"Arrow/Home/End keyboard sizing",
"ARIA separator range",