Skip to content

feat: default autofocus prop value to false - #706

Merged
hejsztynx merged 1 commit into
mainfrom
@ksienkiewicz/feat-autofocus-default
Jul 17, 2026
Merged

hejsztynx merged 1 commit into
mainfrom
@ksienkiewicz/feat-autofocus-default

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

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)

Copilot AI review requested due to automatic review settings July 16, 2026 18:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures EnrichedTextInput does not auto-focus by default on Web (and aligns Native for consistency) by defaulting the autoFocus prop to false when it’s not provided, avoiding Tiptap’s implicit autofocus behavior when autofocus is undefined.

Changes:

  • Default autoFocus to false in the Web EnrichedTextInput prop destructuring so Tiptap receives autofocus: false unless explicitly enabled.
  • Apply the same autoFocus = false default in the Native EnrichedTextInput component for consistent JS-side behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/web/EnrichedTextInput.tsx Defaults autoFocus to false so Tiptap doesn’t auto-focus when the prop is omitted.
src/native/EnrichedTextInput.tsx Mirrors the same defaulting behavior for consistency before passing autoFocus to the native component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kacperzolkiewski kacperzolkiewski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hejsztynx
hejsztynx merged commit 0513dd8 into main Jul 17, 2026
9 checks passed
@hejsztynx
hejsztynx deleted the @ksienkiewicz/feat-autofocus-default branch July 17, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants