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

[BUG]: Table's the prop of selected is accepting only string values #961

Open
1 task
erbilnas opened this issue Nov 27, 2024 · 0 comments
Open
1 task
Labels
bug Something isn't working bug-confirmed When bug confirmed by the maintainers

Comments

@erbilnas
Copy link
Collaborator

Issue description

The bl-table component currently expects the selected prop to always be of type string, even when the actual data IDs are numbers. This creates an inconsistency between the data structure and the expected prop type. The component should be updated to accept both strings and numbers for the selected prop to ensure compatibility and flexibility with various datasets.

There's a workaround for this bug in Vue like this:

/* BUG: This computed property is needed because of a Baklava table bug
where the component expects selected IDs to always be strings,
even when the actual data IDs might be numbers */
const selectedIdsAsStrings = computed(() => {
  if (!props.selected) return []
  return props.selected.map((id) => String(id))
})

Media & Screenshots

Screen.Recording.2024-11-27.at.3.11.14.PM.mov

Baklava Version

3.2.0 (stable)

Operating system

macOS: 15.1.1 (24B91)
Microsoft Edge: Version 131.0.2903.51 (Official build) (arm64)

Priority this issue should have

Medium (should be fixed soon)

Please review the checkboxes that are applicable.

  • This issue is directly related to React
@erbilnas erbilnas added bug Something isn't working bug-confirmed When bug confirmed by the maintainers labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bug-confirmed When bug confirmed by the maintainers
Projects
None yet
Development

No branches or pull requests

1 participant