Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected value for interactiveSelectList #245

Open
mikaelstaldal opened this issue Dec 13, 2024 · 0 comments
Open

Selected value for interactiveSelectList #245

mikaelstaldal opened this issue Dec 13, 2024 · 0 comments

Comments

@mikaelstaldal
Copy link

mikaelstaldal commented Dec 13, 2024

Terminal.interactiveSelectList() returns the visible title of the selected entry. This is not always convenient. It would be useful to specify a (hidden) value in each entry which is returned instead of the title (a bit like HTML <option value="...">).

This could be added to SelectList.Entry:

    data class Entry(
        /** The title of the entry. */
        val title: String,
        /** An optional description of the entry. */
        val description: Widget? = null,
        /** Whether this entry is marked as selected. */
        val selected: Boolean = false,
        /** Return this value instead of title if not null. */
        val value: String? = null,
       )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant