[PR #294] Added a ChangedFunc to Form #900

Open
opened 2026-03-04 01:08:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/294
Author: @mikeschinkel
Created: 6/5/2019
Status: 🔄 Open

Base: masterHead: form_changed


📝 Commits (1)

  • 911ae60 Added a ChangedFunc to Form

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 form.go (+13 -0)

📄 Description

I want to display help for each field, but to do so I need to be called right after a field changes and not before.

I could have hacked it and used the InputField and CheckBox ChangeFuncs, but DropDown did not have one and if I was going to add one why not add for the form?

What my PR does not address is changes with buttons, because Button does not implement FormItem, although I think it should since it is actually an item on a form. If it were a FormItem them my changed code could work for both.

If you agree, I'll be happy to add the required code to make Button a FormItem to this PR. Or you can just accept this PR.

Or neither (but I hope you will accept it, otherwise I'll have to live with a fork.)


🔄 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/rivo/tview/pull/294 **Author:** [@mikeschinkel](https://github.com/mikeschinkel) **Created:** 6/5/2019 **Status:** 🔄 Open **Base:** `master` ← **Head:** `form_changed` --- ### 📝 Commits (1) - [`911ae60`](https://github.com/rivo/tview/commit/911ae60c1492bc5f3ca0cd6498b86486b4037162) Added a ChangedFunc to Form ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `form.go` (+13 -0) </details> ### 📄 Description I want to display help for each field, but to do so I need to be called right after a field changes and not before. I could have hacked it and used the InputField and CheckBox `ChangeFuncs`, but DropDown did not have one and if I was going to add one why not add for the form? What my PR does not address is changes with buttons, because Button does not implement `FormItem`, although I think it should since it is actually an item on a form. If it were a FormItem them my changed code could work for both. If you agree, I'll be happy to add the required code to make `Button` a `FormItem` to this PR. Or you can just accept this PR. Or neither _(but I hope you will accept it, otherwise I'll have to live with a fork.)_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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/tview#900
No description provided.