Picker - Fix wrong offset when items change from search #3493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes bug where for some searched values in the Picker, the FlatList starts at an incorrect offset after the search. The FlatList items change, causing it to change its height and make it start the scroll at some negative offset. I've made it take the entire height that is left so this way the height will not change when the content changes so theres no jump.
I'm not sure if this is the correct solution. As it seems when the items change the FlatList goes under the TextInput, like having a negative offset so the picker item seems cut. After scrolling a little the item goes to its correct place and scroll resets correctly.
Steps to reproduce:
Playground to reproduce:
Changelog
Picker - Fixes incorrect offset after search.
Additional info
MADS-4601