Skip to content

Commit 4af4cc7

Browse files
authored
fix: Remove placeholder on focus (#786)
## Description <!-- Provide a concise and descriptive summary of the changes implemented in this PR. --> ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [x] Other (chores, tests, code style improvements etc.) ### Tested on - [x] iOS - [ ] Android ### Testing instructions Run llm demo apps and click on text box. The placeholder text like `Your message` should disappear even if you do not write anything. ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> Closes #782 - [x] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. -->
1 parent c8053d4 commit 4af4cc7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

apps/llm/app/llm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function LLMScreen() {
9797
? ColorPalette.blueDark
9898
: ColorPalette.blueLight,
9999
}}
100-
placeholder="Your message"
100+
placeholder={isTextInputFocused ? '' : 'Your message'}
101101
placeholderTextColor={'#C1C6E5'}
102102
multiline={true}
103103
ref={textInputRef}

apps/llm/app/llm_structured_output/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ function LLMScreen() {
179179
? ColorPalette.blueDark
180180
: ColorPalette.blueLight,
181181
}}
182-
placeholder="Your message e.g. I'm John. Is this product damaged? I can give you $100 for this."
182+
placeholder={
183+
isTextInputFocused
184+
? ''
185+
: "Your message e.g. I'm John. Is this product damaged? I can give you $100 for this."
186+
}
183187
placeholderTextColor={'#C1C6E5'}
184188
multiline={true}
185189
ref={textInputRef}

apps/llm/app/llm_tool_calling/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function LLMToolCallingScreen() {
146146
? ColorPalette.blueDark
147147
: ColorPalette.blueLight,
148148
}}
149-
placeholder="Your message"
149+
placeholder={isTextInputFocused ? '' : 'Your message'}
150150
placeholderTextColor={'#C1C6E5'}
151151
multiline={true}
152152
ref={textInputRef}

0 commit comments

Comments
 (0)