Skip to content

fix: use loop variable col[:class] instead of assign @col[:class] in table component#164

Merged
phcurado merged 3 commits into
phcurado:mainfrom
georgemarshall:copilot/fixtable
Apr 5, 2026
Merged

fix: use loop variable col[:class] instead of assign @col[:class] in table component#164
phcurado merged 3 commits into
phcurado:mainfrom
georgemarshall:copilot/fixtable

Conversation

@georgemarshall

Copy link
Copy Markdown
Contributor

This pull request fixes a bug in the DaisyUIComponents.Table component where the column-specific class was not being correctly applied to table cells. It also updates the tests to verify that the class is now properly set on the rendered cells.

Component bug fix:

  • Fixed the class assignment in the table cell rendering to use the current column's class (col[:class]) instead of referencing the column definition list (@col[:class]). This ensures that column-specific classes are correctly applied to each cell.

Test improvements:

  • Updated the test table to add a class="col-id" attribute to the "id" column, ensuring that the test checks for the correct application of the class.
  • Enhanced the tests to assert that the rendered "id" cells have the col-id class for both rows, confirming that the fix works as intended. [1] [2]

@phcurado
phcurado merged commit 0d6702a into phcurado:main Apr 5, 2026
12 checks passed
@phcurado

phcurado commented Apr 5, 2026

Copy link
Copy Markdown
Owner

awesome, thank you

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants