Skip to content

Colour the outlined input's placeholder with on-input on iOS - #103

Merged
simonhamp merged 1 commit into
mainfrom
fix/ios-outlined-placeholder-on-input
Sep 19, 2026
Merged

simonhamp merged 1 commit into
mainfrom
fix/ios-outlined-placeholder-on-input

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Follow-up to #60.

#60 added the on-input token, and the README, config comment and Boost guidelines all say it recolours everything inside the outlined box, including the placeholder. Android does that. On iOS the placeholder was passed straight to TextField, so it kept the system grey. On a dark input-fill it was close to invisible.

NativeUITextInputCore now takes an optional placeholderColor and gives it to the field as a prompt. Only the outlined renderer passes one, and it passes theme.onInput, not the fieldDecorationColor fallback. With no colour the prompt is nil and the field falls back to its title, same as before. So filled and bare inputs don't change, and neither does an outlined input in a theme that doesn't declare on-input.

Worth knowing when reviewing: with on-input declared, the placeholder is now the same colour as typed text. That matches Android and the docs, but a placeholder and a real value can no longer be told apart by colour. If we want a dimmer placeholder, that should be a separate change on both platforms.

Testing, on an iOS 26 simulator in a super-native build using the #60 test screen:

  • No on-input declared: the screen is pixel-identical before and after, apart from a few pixels of anti-aliasing noise in the nav bar.
  • Dark fill: the placeholders ("Placeholder only", "Search...", "0") went from unreadable to drawn in on-input.
  • Light fill: placeholders draw in the dark on-input colour.
  • Filled input and typed text: unchanged.

That build runs mobile-ui's feat/macos-renderers branch with #60 on top. The patch doesn't apply cleanly there because the branch's copy of NativeUITextInputCore.swift differs from main, so I applied the same change by hand for the test. Against main itself the Swift type-checks with no new errors.

🤖 Generated with Claude Code

#60 added the on-input token and documented it as recolouring everything
inside the outlined box, placeholder included. Android does that. iOS
passed the placeholder straight to TextField, so it kept the system grey,
which is close to invisible on a dark input-fill.

NativeUITextInputCore takes an optional placeholderColor and hands it to
the field as a prompt. Only the outlined renderer passes one, and only
when on-input is declared, so filled and bare inputs, and outlined inputs
in a theme without on-input, draw what they drew before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 28840e59-cc09-4124-8987-0b9328eac871

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@simonhamp
simonhamp merged commit b4faba9 into main Sep 19, 2026
5 checks passed
@simonhamp
simonhamp deleted the fix/ios-outlined-placeholder-on-input branch September 19, 2026 14:04
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