You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds `showAll` and `hideAll` props to the `TLShapeIndicators`
component.
## Context
As an optimization, we mount indicators for all shapes and hide or show
them dynamically using CSS. This is faster than mounting or unmounting
them dynamically.
There are certain states where we want to hide all of the indicators. We
allow customization of this logic by overriding a the `ShapeIndicators`
component. In tldraw's `ShapeIndicators` component override, we check to
see if we're in one of the select tool's "hide the indicators" states
and return `null` instead of the default indicators component.
However, this means the indicators are unmounted and remounted whenever
they're hidden or shown; and on larger projects, this can be a
performance hit.
## Solution
This PR provides `hideAll` and `showAll` props to the ShapeIndicators
component so that we can allow parent components to control visibility
in a more performant way.
### For later
It would be good to move _all_ of the "hide indicators when in these
states" logic out of the DefaultIndicators component, though this would
be a breaking change.
### Change type
- [x] `bugfix`
- [] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
### Release notes
- Improved performance on large projects when hiding / showing shape
indicators.
- Added `hideAll` and `showAll` props to the `ShapeIndicators` component
props
0 commit comments