Fix empty edit context menu (#4037)
This PR fixes a case where right clicking on an empty canvas would display the edit menu, even when there was nothing to do in the menu. ### Change Type - [ ] `feature` — New feature - [ ] `improvement` — Product improvement - [ ] `api` — API change - [x] `bugfix` — Bug fix - [ ] `other` — Changes that don't affect SDK users, e.g. internal or .com changes ### Test Plan 1. Right click on the canvas ### Release Notes - Fixes a bug where the context menu would display an empty edit menu.
This commit is contained in:
parent
9d02ca9cbe
commit
8250112061
1 changed files with 2 additions and 0 deletions
|
@ -330,6 +330,8 @@ export function DeleteMenuItem() {
|
||||||
|
|
||||||
/** @public @react */
|
/** @public @react */
|
||||||
export function EditMenuSubmenu() {
|
export function EditMenuSubmenu() {
|
||||||
|
if (!useAnySelectedShapesCount(1)) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TldrawUiMenuSubmenu id="edit" label="context-menu.edit" size="small">
|
<TldrawUiMenuSubmenu id="edit" label="context-menu.edit" size="small">
|
||||||
<GroupMenuItem />
|
<GroupMenuItem />
|
||||||
|
|
Loading…
Reference in a new issue