charmbracelet / lipgloss

Style definitions for nice terminal layouts 👄
MIT License
8.03k stars 228 forks source link

ClearRows() should initialize with new NewStringData() #382

Closed JoeyFreeland-DojoFive closed 1 week ago

JoeyFreeland-DojoFive commented 1 month ago

Describe the bug The ClearRows() method of a table sets the data to nil, but in the New() function to create a new table model, it is set to NewStringData(). Therefore if you want to clear a table of all its rows, you will not be able to add rows later. Rows will only be appended if the type of the internal data is StringData, which is not true after calling ClearRows().

Source Code table.go

bashbunni commented 3 weeks ago

Hey, I think this belongs in lipgloss, so going to transfer the issue over there.