Skip to content

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
() => {
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