charmbracelet / charmbracelet/bubbles

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

Open
#729 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
8.9k
Forks
457
Avg merge
1d 18h
Merged PRs (30d)
5

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.