[bug] Group shape behavior
Something's up with group behavior.

- create a rectangle
- create text
- group shapes
- double click text to select it
- double click text to edit it
- click outside to blur text
- move text or rectangle around
Hi @steveruizok I have some idea about this issue:
When the user clicks on some children in a group, the logic in SelectTool.ts will set the selectedGroupId into some value, but when the user clicks outside of the group, or, on the canvas, there's no logic to clean up the selectedGroupId. That's why the second time user click on the group, it will directly drill in and select the children.
you might want to try to handle the clean up in onPointDown(), and also when user press the Esc key to remove focus from the selection:
onPointerDown: TLPointerEventHandler = (info, e) => {
...
if (info.target === 'canvas' && this.status === Status.Idle) {
this.selectedGroupId = undefined
...
}
...
}
Thanks for the analysis! Want to make a PR? If not, I can come back to this in a few days and try to apply your fix.
yes! I am working on it! but somehow one of the test cases in SelectTool.spec.ts can't pass (Edits grouped text on double click after selecting) 😢, the double click behavior is different when it happens in the test env versus actual user triggering it.
Right on! Don't worry about that, feel free to skip the test or write it as a todo. (It may be an issue with the tests themselves).
it has been fixed!