Skip to content

Commit 3bcab08

Browse files
aquaductapeMilo
authored andcommitted
fix gridResizer that becomes stuck when dragging over iframes in Firefox
1 parent 9854c57 commit 3bcab08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/solid-repl/src/components/gridResizer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ export const GridResizer: Component<{
4848

4949
createEffect(() => {
5050
if (isDragging()) {
51+
// Fixes Firefox issue where dragging cursor fails to emit events to overlay, and instead to iframe, resulting in resizer bar not moving.
52+
// use class instead of style because style attribute, when tracked, value is reset. Related to https://github.com/solidjs/solid/issues/1938
53+
document.querySelectorAll('iframe').forEach((el) => el.classList.add('pointer-events-none'));
54+
5155
window.addEventListener('mousemove', onMouseMove);
5256
window.addEventListener('mouseup', onResizeEnd);
5357
window.addEventListener('touchmove', onTouchMove);
5458
window.addEventListener('touchend', onResizeEnd);
5559
} else {
60+
document.querySelectorAll('iframe').forEach((el) => el.classList.remove('pointer-events-none'));
61+
5662
window.removeEventListener('mousemove', onMouseMove);
5763
window.removeEventListener('mouseup', onResizeEnd);
5864
window.removeEventListener('touchmove', onTouchMove);

0 commit comments

Comments
 (0)