[GH-ISSUE #832] SetAcceptanceFunc handler could use an index param #606

Closed
opened 2026-03-04 01:06:24 +03:00 by kerem · 1 comment
Owner

Originally created by @atzub on GitHub (Apr 3, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/832

Currently the handler gets the text coming from the InputField and the rune which was just entered. If the rune appears more than once in the text, there's no telling which one it is. Based on its location, the acceptance logic could change, as just happened for me when I used it to validate an IP with netmask length. I needed to know if the number is to the right of the '/' or not.

Also wanted to say, I'm a big fan of your work rivo, tview is incredible and I enjoy using it very much.

Originally created by @atzub on GitHub (Apr 3, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/832 Currently the handler gets the text coming from the InputField and the rune which was just entered. If the rune appears more than once in the text, there's no telling which one it is. Based on its location, the acceptance logic could change, as just happened for me when I used it to validate an IP with netmask length. I needed to know if the number is to the right of the '/' or not. Also wanted to say, I'm a big fan of your work rivo, tview is incredible and I enjoy using it very much.
kerem closed this issue 2026-03-04 01:06:24 +03:00
Author
Owner

@rivo commented on GitHub (Apr 3, 2023):

That's true. I don't know how to change it without breaking compatibility, though.

<!-- gh-comment-id:1494896208 --> @rivo commented on GitHub (Apr 3, 2023): That's true. I don't know how to change it without breaking compatibility, though.
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#606
No description provided.