[PR #347] [MERGED] Add OnChange handler to the TextInput widget #344

Closed
opened 2026-03-03 16:23:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mum4k/termdash/pull/347
Author: @LQR471814
Created: 1/29/2023
Status: Merged
Merged: 2/8/2023
Merged by: @mum4k

Base: develHead: devel


📝 Commits (4)

  • 2cbce1c Add OnChange event handler to TextInput widget
  • f28390b Fixed an issue with ReadAndClear, Add example to textinputdemo.go, Add tests
  • e87b1cb capitalize text
  • 45f26a8 address comments

📊 Changes

5 files changed (+343 additions, -222 deletions)

View changed files

📝 widgets/textinput/editor.go (+12 -3)
📝 widgets/textinput/editor_test.go (+286 -210)
📝 widgets/textinput/options.go (+15 -0)
📝 widgets/textinput/textinput.go (+1 -2)
📝 widgets/textinput/textinputdemo/textinputdemo.go (+29 -7)

📄 Description

This PR adds an onChange option to the TextInput widget. This is an event handler similar to the existing OnSubmit, it is called whenever a character is inserted or deleted from the TextInput's text content.

Rudimentary tests have been written and an example of it's usage is given in textinputdemo.go.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mum4k/termdash/pull/347 **Author:** [@LQR471814](https://github.com/LQR471814) **Created:** 1/29/2023 **Status:** ✅ Merged **Merged:** 2/8/2023 **Merged by:** [@mum4k](https://github.com/mum4k) **Base:** `devel` ← **Head:** `devel` --- ### 📝 Commits (4) - [`2cbce1c`](https://github.com/mum4k/termdash/commit/2cbce1c330492e8f753f8e135b5566e96d647c2e) Add OnChange event handler to TextInput widget - [`f28390b`](https://github.com/mum4k/termdash/commit/f28390ba72d9aa0bdee84f1bbb52aa82af6223ab) Fixed an issue with ReadAndClear, Add example to textinputdemo.go, Add tests - [`e87b1cb`](https://github.com/mum4k/termdash/commit/e87b1cb791a7ae9e5bd88ddbe9aa3df1bfa96703) capitalize text - [`45f26a8`](https://github.com/mum4k/termdash/commit/45f26a878ddc151888c461412c83ed319618cac1) address comments ### 📊 Changes **5 files changed** (+343 additions, -222 deletions) <details> <summary>View changed files</summary> 📝 `widgets/textinput/editor.go` (+12 -3) 📝 `widgets/textinput/editor_test.go` (+286 -210) 📝 `widgets/textinput/options.go` (+15 -0) 📝 `widgets/textinput/textinput.go` (+1 -2) 📝 `widgets/textinput/textinputdemo/textinputdemo.go` (+29 -7) </details> ### 📄 Description This PR adds an `onChange` option to the TextInput widget. This is an event handler similar to the existing `OnSubmit`, it is called whenever a character is inserted or deleted from the TextInput's text content. Rudimentary tests have been written and an example of it's usage is given in `textinputdemo.go`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:23:59 +03:00
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#344
No description provided.