Enable vertical scroll wheel on horizontal scrollable containers
This commit is contained in:
parent
75eb7c4839
commit
207e46ed4f
|
|
@ -106,6 +106,12 @@ export async function onMouseScroll(e: WheelEvent) {
|
||||||
const target = e.target && (e.target as HTMLElement);
|
const target = e.target && (e.target as HTMLElement);
|
||||||
const inCanvas = target && target.closest(".canvas");
|
const inCanvas = target && target.closest(".canvas");
|
||||||
|
|
||||||
|
const horizontalScrollableElement = e.target instanceof HTMLElement && e.target.closest(".scrollable-x");
|
||||||
|
if (horizontalScrollableElement && e.deltaY !== 0) {
|
||||||
|
horizontalScrollableElement.scrollTo(horizontalScrollableElement.scrollLeft + e.deltaY, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (inCanvas) {
|
if (inCanvas) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const modifiers = makeModifiersBitfield(e);
|
const modifiers = makeModifiersBitfield(e);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue