[fix] fit to content shown on groups (#2946)
This PR fixes a bug where "fit to content" would be shown on groups. ### Change Type - [x] `patch` — Bug fix ### Release Notes - Fix bug where "fit frame to content" would be shown when a group is selected.
This commit is contained in:
parent
2211ca0063
commit
1f3f5f7c4f
1 changed files with 4 additions and 1 deletions
|
@ -87,7 +87,10 @@ export function FitFrameToContentMenuItem() {
|
|||
() => {
|
||||
const onlySelectedShape = editor.getOnlySelectedShape()
|
||||
if (!onlySelectedShape) return false
|
||||
return editor.getSortedChildIdsForParent(onlySelectedShape).length > 0
|
||||
return (
|
||||
editor.isShapeOfType<TLFrameShape>(onlySelectedShape, 'frame') &&
|
||||
editor.getSortedChildIdsForParent(onlySelectedShape).length > 0
|
||||
)
|
||||
},
|
||||
[editor]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue