mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-20 05:21:44 +10:00
react-zoom-pan-pinch calls preventDefault() on its window-level mousedown listener so that dragging the canvas does not select text. That also cancels the browser's native focus shift, so focus stays wherever it was before the pan -- typically the sidebar button that opened the last dialog, since closing a dialog restores focus to its trigger. A focused button activates on Space keyup, so holding space to pan and then releasing it reopened the most recent dialog. Blur the focused element from onPanningStart, which reinstates exactly the focus change the browser would have made on its own. onPanningStart only fires when the mousedown target is inside the transform wrapper, so sidebar and dialog clicks are unaffected, and keyboard-only users never trigger a pointer pan. Closes #3300 Co-authored-by: Amruth Pillai <im.amruth@gmail.com>