-
Notifications
You must be signed in to change notification settings - Fork 734
setitem height, number of visible rows as defaults #2916
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
Conversation
const moveToItem = (index: number, numberOfRows: number, itemHeight: number) => { | ||
|
||
const moveToItem = (index: number, | ||
numberOfRows: number = NUMBER_OF_VISIBLE_ROWS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the number of visible rows, this is the number of rows i.e. props.items.length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it, WDYT about exporting the ITEMS_HEIGHT
?
do we need this small export ?
in the WheelPicker testing you have custom values
|
||
const itemsLength = listDriver.getProps().data?.length ?? 0; | ||
|
||
const moveToItem = (index: number, itemHeight: number, numberOfRows: number = itemsLength) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the default ITEM_HEIGHT taken from the component? The whole point here was to add default values to itemHeight and numberOfRows...
}); | ||
|
||
it('should call onChange after scrolling ends with default itemHeight and numberOfRows', () => { | ||
const itemHeight = 44; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be passed if we want to test the defaults, nighter numberOfRows
expect(onChange).toHaveBeenCalledWith(7, 7); | ||
}); | ||
|
||
it('should call onChange after scrolling ends with default itemHeight and numberOfRows', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just move this test before the other one as we test the defaults first
@adids1221 Approved with a small comment |
Description
WheelPicker driver set default values
Changelog
WheelPicker driver set default values
Additional info