diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 2b2bc37b..54796e7f 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -11,6 +11,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis ## Next - Fixed a bug in `` where dynamically changing slotted items wouldn't update the tree properly +- Fixed a bug in `` that caused the panel to stack when clicking on the divider in mobile versions of Chrome [#862](https://github.com/shoelace-style/shoelace/issues/862) - Improved single selection in `` so nodes expand and collapse and receive selection when clicking on the label - Renamed `expanded-icon` and `collapsed-icon` slots to `expand-icon` and `collapse-icon` in the experimental `` and `` components - Improved RTL support for `` diff --git a/src/components/split-panel/split-panel.ts b/src/components/split-panel/split-panel.ts index 5921aedb..e16e37a1 100644 --- a/src/components/split-panel/split-panel.ts +++ b/src/components/split-panel/split-panel.ts @@ -110,7 +110,9 @@ export default class SlSplitPanel extends ShoelaceElement { } // Prevent text selection when dragging - event.preventDefault(); + if (event.cancelable) { + event.preventDefault(); + } drag(this, { onMove: (x, y) => { diff --git a/src/internal/drag.ts b/src/internal/drag.ts index 5e67b422..35088400 100644 --- a/src/internal/drag.ts +++ b/src/internal/drag.ts @@ -38,7 +38,7 @@ export function drag(container: HTMLElement, options?: Partial) { document.addEventListener('pointerup', stop); // If an initial event is set, trigger the first drag immediately - if (options?.initialEvent) { + if (options?.initialEvent?.type === 'pointermove') { move(options.initialEvent); } }