Skip to content

Add option in List to hide separators #3756

Closed
@dweymouth

Description

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

The List widget has a lot of nice builtins but if the developer wants a non-interactive list (eg to display a log file as recently discussed in the discord), or if the row widgets themselves handle interactivity, then it is not really suitable to use the existing List without forking it to comment out builtin behavior.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

The List widget should have new publicly exported flags:

type List struct {
    // ...
    DisableSelection bool
    DisableRowFocus bool
    DisableHover bool
    NoSeparator bool
    // ...
}

Or perhaps DisableSelection should disable rows being focusable and hoverable as well, and in that case be named DisableInteractivity?

Also, maybe instead of DisableSelection, have a new enum SelectionMode once multi-select is actually implemented:

type SelectionMode int

const (
    SelectionModeSingle SelectionMode = iota // default, since existing behavior is single-select
    SelectionModeMulti
    SelectionModeNone
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions