Android: Keyboard dismisses on first character when using conditional Text in ZStack
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
Found a bug where if we use an if like this, the first letter typed on Android causes the keyboard to dismiss. After that, it works normally. I’m working around it by using opacity instead of if. Not sure if this affects any other Skip toolchain besides Swift 6.2.0 Dev.
ZStack(alignment: .leading) {
if text.isEmpty {
Text(placeholder)
.foregroundColor(placeholderColor)
.fontStyle(textFont)
}
TextField("", text: $text)
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied ZStack reproduction using conditional Text and TextField, then compare it with the opacity workaround on Android. The fix is done when entering the first character no longer dismisses the keyboard; no specific source file or test is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100