Skip to content

Allow to specify show_numbers in ChoiceInput #2058

@Lauszus

Description

@Lauszus

It would be nice to be able to hide the numbers when using ChoiceInput by setting show_numbers to False:

Currently I have hidden them using this hack:

class ChoiceInputNoNumbers(ChoiceInput[_T]):
    """ChoiceInput with row numbers hidden."""

    @override
    def _create_application(self) -> Application[_T]:
        app = super()._create_application()
        ctrl = app.layout.current_window.content
        if hasattr(ctrl, "text") and isinstance(getattr(ctrl.text, "__self__", None), RadioList):
            ctrl.text.__self__.show_numbers = False
        return app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions