Skip to content

Having Foreground in table.DefaultStyles().Cell breaks the styles from Selected #729

@rmscoal

Description

@rmscoal

Describe the bug
I tried applying Cell foreground color differently than default (which was white) whilst also applying foreground in Selected breaks the ui of the table.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS: macOs
  • Shell: zsh
  • Terminal Emulator: iTerm2
  • Terminal Multiplexer: -
  • Locale: en_US.UTF-8

To Reproduce
Steps to reproduce the behavior:

  1. Copy the table example code: https://github.com/charmbracelet/bubbletea/blob/main/examples/table/main.go
  2. Add s.Cell = s.Cell.Foreground(lipgloss.Color("26")) beneath s.Selected (line 176)
  3. Run the app and you will see something weird.

Source Code
Please include source code if needed to reproduce the behavior.

Expected behavior
The Selected styles should be applied to the whole row. This case, the background was not applied to all the selected row cells. Furthermore, the Foreground from Selected was also not applied where it should have been applied.

Screenshots
Image

Additional context
Add any other context about the problem here.

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