Skip to content

how to implement a custom validator for a custom TokenListControl #430

Open
@ghost

Description

I am writing a custom checkbox widget based on prompt-toolkit. So far it works great. Now I want to add a validator so I can validate that for example at least one checkbox has been selected.
I understand that prompt-toolkit validators work on a Document which in turn is part of a Buffer. A TokenListControl has none of that. I could raise a ValidationError from my validator which runs in own scope - so it does not help much...
Any suggestions on how to best approach this? Are there any hooks I can use, do I use a bottom_toolbar (additional TokenListControl) to implement the validation message display myself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions