[GH-ISSUE #65] Widget: Text input #48

Closed
opened 2026-03-03 16:21:55 +03:00 by kerem · 2 comments
Owner

Originally created by @mum4k on GitHub (Jan 13, 2019).
Original GitHub issue: https://github.com/mum4k/termdash/issues/65

Originally assigned to: @mum4k on GitHub.

Implement a widget that will allow the user to provide text input. Either single or multi-line.

Originally created by @mum4k on GitHub (Jan 13, 2019). Original GitHub issue: https://github.com/mum4k/termdash/issues/65 Originally assigned to: @mum4k on GitHub. Implement a widget that will allow the user to provide text input. Either single or multi-line.
kerem 2026-03-03 16:21:55 +03:00
Author
Owner

@mum4k commented on GitHub (Apr 2, 2019):

We will want:

  • draw "cursor" when container is focused or when registered for global keyboard
  • user provided or automatic width
  • single line of unicode runes
  • scrolling left / right with arrows + text trimming
  • text label above or to the left of
  • ability to get content and clear atomically via:
    • API call (i.e. from another widget like a button).
    • internal trigger (i.e. pressing the Enter key).

For inspiration:
https://github.com/VladimirMarkelov/clui

API proposal:

type CallbackFn func(text string) error

type TextInput struct {}

func New(Callback(cFn)) (*TextInput, error) {}

func (ti *TextInput) Read() string {}

func (ti *TextInput) ReadAndClear() string {}
<!-- gh-comment-id:478828602 --> @mum4k commented on GitHub (Apr 2, 2019): We will want: - draw "cursor" when container is focused or when registered for global keyboard - user provided or automatic width - single line of unicode runes - scrolling left / right with arrows + text trimming - text label above or to the left of - ability to get content and clear atomically via: - API call (i.e. from another widget like a button). - internal trigger (i.e. pressing the Enter key). For inspiration: https://github.com/VladimirMarkelov/clui API proposal: ```go type CallbackFn func(text string) error type TextInput struct {} func New(Callback(cFn)) (*TextInput, error) {} func (ti *TextInput) Read() string {} func (ti *TextInput) ReadAndClear() string {} ```
Author
Owner

@mum4k commented on GitHub (Apr 27, 2019):

Implemented and pushed to the devel branch.

<!-- gh-comment-id:487261493 --> @mum4k commented on GitHub (Apr 27, 2019): Implemented and pushed to the devel branch.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#48
No description provided.