Skip to content

Commit 0cb072a

Browse files
authored
Fix styling of footer when using base style with filter input (#120)
* Fix styling of footer when using base style with filter input * More efficient and safer style application
1 parent a3b97a9 commit 0cb072a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

table/footer.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@ func (m Model) renderFooter(width int, includeTop bool) string {
3434

3535
// paged feature enabled
3636
if m.pageSize != 0 {
37-
sections = append(sections, fmt.Sprintf("%d/%d", m.CurrentPage(), m.MaxPages()))
37+
str := fmt.Sprintf("%d/%d", m.CurrentPage(), m.MaxPages())
38+
if m.filtered && m.filterTextInput.Focused() {
39+
// Need to apply inline style here in case of filter input cursor, because
40+
// the input cursor resets the style after rendering. Note that Inline(true)
41+
// creates a copy, so it's safe to use here without mutating the underlying
42+
// base style.
43+
str = m.baseStyle.Inline(true).Render(str)
44+
}
45+
sections = append(sections, str)
3846
}
3947

4048
footerText := strings.Join(sections, " ")

0 commit comments

Comments
 (0)