Skip to content

Binder: TextFieldState is bound without members or a way to create it #73

Closed

Description

@b-re-w

pythonx-compose TextField design (#10 there) uses the state-based overload TextField(state=...) of Compose 1.11 (typing stays in Compose; no Python round trip per key). In the stubs (run 37098191598) androidx/compose/foundation/text/input/__init__.pyi has class TextFieldState: with no members, and nothing returns one.

Needed, under Kotlin names:

  1. androidx.compose.foundation.text.input.rememberTextFieldState(initialText = "", initialSelection = ...) (@composable, defaults)
  2. the TextFieldState(initialText, initialSelection) constructor (outside a composition)
  3. the TextFieldState.text getter (CharSequence; reading it from Python should give a str)
  4. the extension functions TextFieldState.setTextAndPlaceCursorAtEnd(String) and TextFieldState.clearText()

First find out why these are missing (package not walked? declined — with which reason? value-class/inline/opt-in?) and fix that cause rather than special-casing TextFieldState.

Completion: a :ksp-fixtures:compose test creates a TextFieldState from Python (both ways), draws TextField(state=s), sets text with setTextAndPlaceCursorAtEnd and reads s.text back as str; the regenerated stubs carry the four members; all modules green.

Activity

  1. b-re-w commented on Oct 3, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions