[fix] Replace findLast
for browser compat (#1822)
Previously, we'd used `Array.findLast` in `getSelectedShapeAtPoint`. This PR removes that newish JS call and replaces it with a `replace` and `find` instead. Closes bug mentioned in https://github.com/tldraw/tldraw/issues/1798. ### Change Type - [x] `patch` — Bug fix
This commit is contained in:
parent
57b2cf6955
commit
fd71bd1b5f
1 changed files with 2 additions and 1 deletions
|
@ -4232,7 +4232,8 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
const { selectedShapeIds } = this
|
||||
return this.currentPageShapesSorted
|
||||
.filter((shape) => shape.type !== 'group' && selectedShapeIds.includes(shape.id))
|
||||
.findLast((shape) => this.isPointInShape(shape, point, { hitInside: true, margin: 0 }))
|
||||
.reverse() // findlast
|
||||
.find((shape) => this.isPointInShape(shape, point, { hitInside: true, margin: 0 }))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue