skiptools / skiptools/skip-ui

Android: Keyboard dismisses on first character when using conditional Text in ZStack

Open
#247 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.