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

Add KeyedList question type along with render, configuration, and tests. #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

firephreek
Copy link

New question type that derives from List but allows choice selection via alpha-numeric keypress. By default, keys are generated using the first letter or number of the provided label. Multiple keys can be cycled through by repeated key presses.

KeyedList supports an auto_confirm keyword argument (defaults to False) that allows an entry to be selected just by the its corresponding key. It's theme is derived from List and unit tests are also taken directly from List along with new tests to confirm all selection behaviors and most variations.

Open design decisions: Adding surround or leading characters to the key in label and possibly adding theming to call out the available key press. Otherwise, KeyedList should be able to serve as a drop in replacement for List without any change to the underlying functionality including instantiation.

KeyedList derives its behavior from List but allows the developer to define an explicit key press associated with each element that a user can use to directly select that entry vs. key Up/Down.
KeyedList supports an `auto_confirm` argument that allows an entry to be selected just by the corresponding key. Also supports multiple key matches by jumping through selections on each key press.
@staticdev
Copy link
Collaborator

@firephreek thank for your change. Do you mind rebasing it?

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

Successfully merging this pull request may close these issues.

2 participants