Make the Text tool delete empty text layers when clicking away wth LMB (#2192)

Fix additions of layers when using left click

Fixes: https://discord.com/channels/731730685944922173/881073965047636018/1327376421034922045
This commit is contained in:
mTvare
2025-01-12 18:17:44 -08:00
committed by GitHub
parent 3582126ded
commit d692538736
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -172,8 +172,8 @@ export function createInputManager(editor: Editor, dialog: DialogState, portfoli
}
if (!inTextInput && !inContextMenu) {
const isRightClick = e.button === 2;
if (textToolInteractiveInputElement) editor.handle.onChangeText(textInputCleanup(textToolInteractiveInputElement.innerText), isRightClick);
const isLeftOrRightClick = e.button === 2 || e.button === 0;
if (textToolInteractiveInputElement) editor.handle.onChangeText(textInputCleanup(textToolInteractiveInputElement.innerText), isLeftOrRightClick);
else viewportPointerInteractionOngoing = isTargetingCanvas instanceof Element;
}