Skip to content

Teleprompter editor cannot receive keyboard focus on an empty script #53

Description

@frizzyTAIM

In v0.6.5, opening the Teleprompter with an empty script shows the TextEditor and the “Paste the script here” placeholder, but the editor does not accept keyboard input or paste.

Reproduction

  1. Open Cyclop.
  2. Open the Teleprompter tab with an empty script.
  3. Click inside the editor.
  4. Try typing or pasting text.

The editor is visible but does not receive keyboard focus.

Root cause

TeleprompterPane renders the editor when either:

editing || prompter.script.isEmpty

but keyboard focus is assigned using:

focused = wants && editing

So for the initial empty-script state, the editor is rendered while editing == false, preventing it from becoming focused.

Fix tested locally

Changing the focus condition to:

focused = wants && (editing || prompter.script.isEmpty)

and initializing editing/focus when the pane appears with an empty script:

.onAppear {
    prompter.rewind()
    if prompter.script.isEmpty {
        editing = true
        wantsKeyboard = true
        focused = true
    }
}

fixes the issue locally.

Tested after rebuilding Cyclop from source on v0.6.5. Typing and paste both work normally after the change.

Activity

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

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions