Skip to content

Wrap around validation for select list #18

@SandPod

Description

@SandPod

Add tests that validate the wrap around behavior for select and multiselect prompts.

Hints from the author if fixes are required:

  _SelectState prev() {
    return _SelectState(
      options: options,
      selectedIndex: (selectedIndex - 1 + options.length) % options.length,
      selectedOptions: selectedOptions,
      multiple: multiple,
    );
  }
  _SelectState next() {
    return _SelectState(
      options: options,
      selectedIndex: (selectedIndex + 1) % options.length,
      selectedOptions: selectedOptions,
      multiple: multiple,
    );

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