[fix] missing border on group shape when unlocked (#2075)

This PR fixes a bug where the indicator on a locked group (or any
shape!) would not appear when the shape was unlocked. This happens
because the `memo` equality checker filtered out changes to the shape's
locked property if they did not effect any other properties.

![Kapture 2023-10-13 at 14 44
31](https://github.com/tldraw/tldraw/assets/23072548/c40442e0-8d18-4ed0-863c-c2b73da81f28)

### Change Type

- [x] `patch` — Bug fix

### Release Notes

- Fix case where indicator was not shown when unlocking groups
This commit is contained in:
Steve Ruiz 2023-10-13 16:13:47 +01:00 committed by GitHub
parent 22955bb0ec
commit ff9c1655f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 28 deletions

View file

@ -11,7 +11,11 @@ import { OptionalErrorBoundary } from './ErrorBoundary'
class ShapeWithPropsEquality {
constructor(public shape: TLShape | undefined) {}
equals(other: ShapeWithPropsEquality) {
return this.shape?.props === other?.shape?.props && this.shape?.meta === other?.shape?.meta
return (
this.shape?.isLocked === other?.shape?.isLocked &&
this.shape?.props === other?.shape?.props &&
this.shape?.meta === other?.shape?.meta
)
}
}