textfields: make them consistent (#2984)

as i look into textfields the places where we are using them are
out-of-sync at the moment. this brings them in line with each other for
further refactoring later.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
Mime Čuvalo 2024-02-29 12:15:57 +00:00 committed by GitHub
parent 4f07e696e8
commit 83423cd6d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -76,6 +76,7 @@ export const ArrowTextLabel = React.memo(function ArrowTextLabel({
onChange={handleChange} onChange={handleChange}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
onBlur={handleBlur} onBlur={handleBlur}
onTouchEnd={stopEventPropagation}
onContextMenu={stopEventPropagation} onContextMenu={stopEventPropagation}
onPointerDown={handleInputPointerDown} onPointerDown={handleInputPointerDown}
onDoubleClick={handleDoubleClick} onDoubleClick={handleDoubleClick}

View file

@ -120,6 +120,7 @@ export const TextLabel = React.memo(function TextLabel<
onChange={handleChange} onChange={handleChange}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
onBlur={handleBlur} onBlur={handleBlur}
onTouchEnd={stopEventPropagation}
onContextMenu={stopEventPropagation} onContextMenu={stopEventPropagation}
onPointerDown={handleInputPointerDown} onPointerDown={handleInputPointerDown}
onDoubleClick={handleDoubleClick} onDoubleClick={handleDoubleClick}

View file

@ -118,11 +118,11 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
autoCapitalize="false" autoCapitalize="false"
autoCorrect="false" autoCorrect="false"
autoSave="false" autoSave="false"
autoFocus={isEditing} autoFocus
placeholder="" placeholder=""
spellCheck="true" spellCheck="true"
wrap="off" wrap="off"
dir="ltr" dir="auto"
datatype="wysiwyg" datatype="wysiwyg"
defaultValue={text} defaultValue={text}
onFocus={handleFocus} onFocus={handleFocus}