mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
filter out selection elements on restore (#901)
* filter out selection elements on restore * add comment
This commit is contained in:
parent
c95dcf2682
commit
13b838117c
1 changed files with 5 additions and 1 deletions
|
@ -13,7 +13,11 @@ export function restore(
|
||||||
opts?: { scrollToContent: boolean },
|
opts?: { scrollToContent: boolean },
|
||||||
): DataState {
|
): DataState {
|
||||||
const elements = savedElements
|
const elements = savedElements
|
||||||
.filter(el => !isInvisiblySmallElement(el))
|
.filter(el => {
|
||||||
|
// filtering out selection, which is legacy, no longer kept in elements,
|
||||||
|
// and causing issues if retained
|
||||||
|
return el.type !== "selection" && !isInvisiblySmallElement(el);
|
||||||
|
})
|
||||||
.map(element => {
|
.map(element => {
|
||||||
let points: Point[] = [];
|
let points: Point[] = [];
|
||||||
if (element.type === "arrow") {
|
if (element.type === "arrow") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue