Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply even/odd classes correctly when rows are grouped #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spike-rabbit
Copy link
Collaborator

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

When using groups, all rows are marked as odd

What is the new behavior?

When using groups, all rows are marked as event / odd toggling in their group. So, the first element in a group will always be even.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No (except for the correct typing, but since this is not released, we don't need a notice here.

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@spike-rabbit spike-rabbit self-assigned this Nov 4, 2024
@spike-rabbit spike-rabbit force-pushed the refactor/improve-rowindex-types branch from e62e202 to c15be94 Compare November 4, 2024 16:08
@spike-rabbit spike-rabbit requested a review from timowolf November 4, 2024 16:09
Copy link
Member

@timowolf timowolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reevaluate the string type for the group index row index combination

return this.rowIndex;
}

const [, innerIndex] = this.rowIndex.match(/\d+-(\d+)/);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to not use a string as a group - group item index but use two entries in a structure like groupIndex and rowIndex. I do not like the regex approach here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not using a string will be a breaking change as we emit this type. While I would love to do this, I think we should wait and first just have the types.

* Represents the index of row. Usually a number.
* If the Row is grouped it returns a string with this pattern: `<indexOfGroup>-<indexOfRowInGroup>`
*/
export type RowIndex = number | `${number}-${number}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to use a string? I would prefer to have a composite here.

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.

2 participants