Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null checks on gridRect to avoid safari error #4599

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modules/ZoomPanSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ export default class ZoomPanSelection extends Toolbar {
e.type === 'mouseleave'
) {
// we will be calling getBoundingClientRect on each mousedown/mousemove/mouseup
let gridRectDim = me.gridRect.getBoundingClientRect()
let gridRectDim = me.gridRect?.getBoundingClientRect()

if (me.w.globals.mousedown) {
if (gridRectDim && me.w.globals.mousedown) {
// user released the drag, now do all the calculations
me.endX = me.clientX - gridRectDim.left
me.endY = me.clientY - gridRectDim.top
Expand Down