fix: canvas panning stops when hovering over frame title (#10340) (#10351)

* fix: canvas panning stops when hovering over frame title (#10340)

* improve

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
gothamsidd
2025-11-18 14:54:02 +05:30
committed by GitHub
parent 7f66e1fe89
commit 37882c66cb
2 changed files with 5 additions and 2 deletions

View File

@@ -105,6 +105,7 @@ export const CLASSES = {
SEARCH_MENU_INPUT_WRAPPER: "layer-ui__search-inputWrapper", SEARCH_MENU_INPUT_WRAPPER: "layer-ui__search-inputWrapper",
CONVERT_ELEMENT_TYPE_POPUP: "ConvertElementTypePopup", CONVERT_ELEMENT_TYPE_POPUP: "ConvertElementTypePopup",
SHAPE_ACTIONS_THEME_SCOPE: "shape-actions-theme-scope", SHAPE_ACTIONS_THEME_SCOPE: "shape-actions-theme-scope",
FRAME_NAME: "frame-name",
}; };
export const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai"; export const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";

View File

@@ -1476,6 +1476,7 @@ class App extends React.Component<AppProps, AppState> {
return ( return (
<div <div
id={this.getFrameNameDOMId(f)} id={this.getFrameNameDOMId(f)}
className={CLASSES.FRAME_NAME}
key={f.id} key={f.id}
style={{ style={{
position: "absolute", position: "absolute",
@@ -11252,12 +11253,13 @@ class App extends React.Component<AppProps, AppState> {
( (
event: WheelEvent | React.WheelEvent<HTMLDivElement | HTMLCanvasElement>, event: WheelEvent | React.WheelEvent<HTMLDivElement | HTMLCanvasElement>,
) => { ) => {
// if not scrolling on canvas/wysiwyg, ignore
if ( if (
!( !(
event.target instanceof HTMLCanvasElement || event.target instanceof HTMLCanvasElement ||
event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLTextAreaElement ||
event.target instanceof HTMLIFrameElement event.target instanceof HTMLIFrameElement ||
(event.target instanceof HTMLElement &&
event.target.classList.contains(CLASSES.FRAME_NAME))
) )
) { ) {
// prevent zooming the browser (but allow scrolling DOM) // prevent zooming the browser (but allow scrolling DOM)