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 randomly selected rows #164 #231

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shawnphoffman
Copy link

Fixes #164. Issue occurs when children string property is an empty array.

Updated createSamples to randomly exclude children.

TODO

  • Create tests

Fixes bryanmylee#164
Issue occurs when children string property is an empty array
@@ -35,8 +35,17 @@ export const addSubRows =
NewTablePropSet<never>
> =>
() => {
const getChildren: ValidChildrenFn<Item> =
children instanceof Function ? children : (item) => item[children] as unknown as Item[];
let getChildren: ValidChildrenFn<Item>;
Copy link
Owner

Choose a reason for hiding this comment

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

Given that ValidChildrenFn has an optional return value, the original intention is that getChildren should return undefined if invalid.

Furtherfore, there is a semantic difference between returning [] and undefined, so the added unknownVal.length > 0 check is an incorrect addition.

@bryanmylee
Copy link
Owner

It seems like the original issue stems from IDs being incorrectly selected when there are no valid children?

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.

addSelectedRows body props do not update with selected state
2 participants