Explorar o código

fix: should blur all inputs after exiting edit mode

Peng Xiao %!s(int64=3) %!d(string=hai) anos
pai
achega
6e0ed52af6

+ 3 - 0
tldraw/packages/core/src/lib/tools/TLSelectTool/states/EditingShapeState.ts

@@ -51,6 +51,9 @@ export class EditingShapeState<
           e.stopPropagation()
           e.stopPropagation()
           this.app.setSelectedShapes([this.editingShape])
           this.app.setSelectedShapes([this.editingShape])
           this.tool.transition('idle')
           this.tool.transition('idle')
+
+          // Blur all inputs when exit idle
+          document.querySelectorAll<HTMLElement>('input,textarea').forEach(el => el.blur())
         })
         })
         break
         break
       }
       }