Dialog prevents page scaling with scroll
Describe the bug
When dialog is opened you can't scale page using CTRL + Wheel. It is possible only when dialog has it's own scrollbar and there's room to scroll, meaning:
- You scrolled to top of dialog, now you can't increase the scale of page using
CTRL + Wheel, but you can reduce scale by scrolling the other way. - You scrolled to bottom of dialog, now you cant reduce the scale of page using
CTRL + Wheel, but you can increase scale by scrolling the other way.
To Reproduce Steps to reproduce the behavior:
- Go to https://kobalte.dev/docs/core/components/dialog#example
- Click on "Open" to open dialog
- Scroll up or down with
CTRL - Page doesn't scale
Expected behavior Page should scale as without dialog (or dialog with available space to scroll).
Desktop:
- OS: [Windows]
- Browser [Chrome]
This is troubling to consider, because browser and OS behavior around shortcuts like this seem to have historically been a bit 'how ya goin' 🦘
https://stackoverflow.com/questions/51515484/chrome-latest-v68-zoom-page-using-ctrl-scroll
https://www.reddit.com/r/MacOS/comments/u3naol/mac_equivalent_of_ctrlmouse_scroll_to_zoom_in_a/
Not sure what way the authors would go, I would suggest using the keyboard and mouse solid-primitives to enable the behavior if its critical though.
solid-prevent-scroll is in charge of this. It would need to detect browsers that support ctrl-scroll and not block that interaction.
The Kobalte component is also blocking pinch gesture zoom, which can be fixed by adding
createPreventScroll({
element: () => ref ?? null,
enabled: () => context.contentPresent() && context.preventScroll(),
+ allowPinchZoom: true,
});
This should really be done with CSS instead.