Skip to content

Commit 0513dd8

Browse files
authored
feat: default autofocus prop value to false (#706)
# Summary On web when `autoFocus` prop was not provided in `EnrichedTextInput` - it was `undefined`, Tiptap would default to the enabled autofocus, which we don't want. Now the `autoFocus` prop defaults to `false` if not provided. Added the same default value in the native `EnrichedTextInput` component for consistency. That change does practically nothing, as earlier it also defaulted to a disabled auto-focus if not provided, but it was handled on the native side - now it happens earlier in JS. ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ | | Web | ✅ | ## Checklist - [ ] E2E tests are passing - [ ] Required E2E tests have been added (if applicable)
1 parent d04d1df commit 0513dd8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/native/EnrichedTextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type HtmlRequest = {
4848

4949
export const EnrichedTextInput = ({
5050
ref,
51-
autoFocus,
51+
autoFocus = false,
5252
editable = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.editable,
5353
mentionIndicators = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.mentionIndicators.slice(),
5454
defaultValue,

src/web/EnrichedTextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function runFocused(
9191
export const EnrichedTextInput = ({
9292
ref,
9393
defaultValue,
94-
autoFocus,
94+
autoFocus = false,
9595
editable = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.editable,
9696
placeholder = '',
9797
placeholderTextColor,

0 commit comments

Comments
 (0)