Colour the outlined input's placeholder with on-input on iOS - #103
Merged
Merged
Conversation
#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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #60.
#60 added the
on-inputtoken, 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 toTextField, so it kept the system grey. On a darkinput-fillit was close to invisible.NativeUITextInputCorenow takes an optionalplaceholderColorand gives it to the field as aprompt. Only the outlined renderer passes one, and it passestheme.onInput, not thefieldDecorationColorfallback. 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 declareon-input.Worth knowing when reviewing: with
on-inputdeclared, 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:
on-inputdeclared: the screen is pixel-identical before and after, apart from a few pixels of anti-aliasing noise in the nav bar.on-input.on-inputcolour.That build runs mobile-ui's
feat/macos-renderersbranch with #60 on top. The patch doesn't apply cleanly there because the branch's copy ofNativeUITextInputCore.swiftdiffers 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