From cc3bd1d1142cf82ff93f7009053607c87e91a688 Mon Sep 17 00:00:00 2001 From: Takuto Mori Gump Date: Tue, 19 Sep 2023 01:54:22 +0900 Subject: [PATCH] :recycle: fix: editing is not terminated after the conversion is confirmed. (#1885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes: #1883 Fix bug: editing is not terminated after the conversion is confirmed. ### before https://github.com/tldraw/tldraw/assets/24749358/7821a8b1-70a8-448f-802b-2a791c2fe159 ### after https://github.com/tldraw/tldraw/assets/24749358/2104f3bd-75c5-4551-bd41-315957d1a533 ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - fix: editing is not terminated after the conversion is confirmed. Co-authored-by: Steve Ruiz --- .../tldraw/src/lib/shapes/frame/components/FrameLabelInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tldraw/src/lib/shapes/frame/components/FrameLabelInput.tsx b/packages/tldraw/src/lib/shapes/frame/components/FrameLabelInput.tsx index dcf8b398c..513598111 100644 --- a/packages/tldraw/src/lib/shapes/frame/components/FrameLabelInput.tsx +++ b/packages/tldraw/src/lib/shapes/frame/components/FrameLabelInput.tsx @@ -10,7 +10,7 @@ export const FrameLabelInput = forwardRef< const handleKeyDown = useCallback( (e: React.KeyboardEvent) => { - if (e.key === 'Enter') { + if (e.key === 'Enter' && !e.nativeEvent.isComposing) { // need to prevent the enter keydown making it's way up to the Idle state // and sending us back into edit mode e.stopPropagation()