Skip to content

[codex] Add auto-growing text inputs#3

Draft
Matildevoldsen wants to merge 1 commit into
NativePHP:mainfrom
Matildevoldsen:codex/text-input-autogrow
Draft

[codex] Add auto-growing text inputs#3
Matildevoldsen wants to merge 1 commit into
NativePHP:mainfrom
Matildevoldsen:codex/text-input-autogrow

Conversation

@Matildevoldsen

Copy link
Copy Markdown

Summary

Adds first-class auto-growing multiline text input support for Native UI text inputs.

  • adds a PHP autoGrow(int $minLines = 1, int $maxLines = 5) API and Blade auto-grow / autoGrow attribute support
  • keeps the existing multiline, minLines, and maxLines behavior compatible
  • wires the auto_grow prop through Android shared text input parsing and the chromeless BareTextInputRenderer
  • wires the auto_grow prop through SwiftUI and asks vertical text fields to use intrinsic height with fixedSize(horizontal: false, vertical: true)
  • moves text input behavior methods into a small concern so BaseTextInput.php stays under 300 lines

Why

Chat composer style inputs need to grow naturally from one line up to a capped number of lines without each app estimating wrapped line counts in Blade/PHP. Native UI already has multiline inputs; this adds the explicit API and native hints needed for textarea-style auto-growth.

Validation

Passed:

vendor/bin/pest tests/TextInputAutoGrowTest.php --colors=never
php -l src/Elements/BaseTextInput.php
php -l src/Elements/Concerns/ConfiguresTextInputBehavior.php
php -l tests/TextInputAutoGrowTest.php
git diff --check

Current upstream/fresh-clone test blockers, unrelated to this change:

vendor/bin/pest --colors=never
# Fails before project tests run because Native\Mobile\Icon\IosSymbol is missing from the installable nativephp/mobile dependency.

vendor/bin/pest tests/PluginTest.php tests/TextInputAutoGrowTest.php --colors=never
# PluginTest fails because it checks resources/ios/ButtonRenderer.swift, while upstream currently has resources/ios/NativeUIButtonRenderer.swift.

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.

1 participant