Fix spacebar/mmb panning bug. (#3791)
We had a bug in our inputs logic that would allow a long press timeout to be triggered if a user started pointing before holding spacebar. This PR fixes that bug! Thanks to @ds300 for the spot. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `bugfix` — Bug fix ### Release Notes - Fix bug with panning
This commit is contained in:
parent
18b03624d5
commit
625d59e468
1 changed files with 10 additions and 4 deletions
|
@ -8543,10 +8543,16 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
// Close any open menus
|
||||
this.clearOpenMenus()
|
||||
|
||||
// Start a long press timeout
|
||||
this._longPressTimeout = setTimeout(() => {
|
||||
this.dispatch({ ...info, name: 'long_press' })
|
||||
}, LONG_PRESS_DURATION)
|
||||
if (!this.inputs.isPanning) {
|
||||
// Start a long press timeout
|
||||
this._longPressTimeout = setTimeout(() => {
|
||||
this.dispatch({
|
||||
...info,
|
||||
point: this.inputs.currentScreenPoint,
|
||||
name: 'long_press',
|
||||
})
|
||||
}, LONG_PRESS_DURATION)
|
||||
}
|
||||
|
||||
// Save the selected ids at pointer down
|
||||
this._selectedShapeIdsAtPointerDown = this.getSelectedShapeIds()
|
||||
|
|
Loading…
Reference in a new issue