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
|
// Close any open menus
|
||||||
this.clearOpenMenus()
|
this.clearOpenMenus()
|
||||||
|
|
||||||
// Start a long press timeout
|
if (!this.inputs.isPanning) {
|
||||||
this._longPressTimeout = setTimeout(() => {
|
// Start a long press timeout
|
||||||
this.dispatch({ ...info, name: 'long_press' })
|
this._longPressTimeout = setTimeout(() => {
|
||||||
}, LONG_PRESS_DURATION)
|
this.dispatch({
|
||||||
|
...info,
|
||||||
|
point: this.inputs.currentScreenPoint,
|
||||||
|
name: 'long_press',
|
||||||
|
})
|
||||||
|
}, LONG_PRESS_DURATION)
|
||||||
|
}
|
||||||
|
|
||||||
// Save the selected ids at pointer down
|
// Save the selected ids at pointer down
|
||||||
this._selectedShapeIdsAtPointerDown = this.getSelectedShapeIds()
|
this._selectedShapeIdsAtPointerDown = this.getSelectedShapeIds()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue