After recent changes, whenever a user changes the category using the category icons one by one (quickly), picker would change category's index twice (e.g. 0->1->2->1->2 whereas it should only be 0->1->2) - 1) in onPress handler on a category icon and 2) with onMomentumScroll handler.
Fix
Category needs to be changed only with one method at a time thus skipping onMomentumScrollEnd handler whenever the momentum did not start helped (adding additional onMomentumScrollBegin handler was required)
Steps to reproduce the issue
open an emoji picker with category icons either on top or bottom
Issue
After recent changes, whenever a user changes the category using the category icons one by one (quickly), picker would change category's index twice (e.g. 0->1->2->1->2 whereas it should only be 0->1->2) - 1) in onPress handler on a category icon and 2) with onMomentumScroll handler.
Fix
Category needs to be changed only with one method at a time thus skipping onMomentumScrollEnd handler whenever the momentum did not start helped (adding additional onMomentumScrollBegin handler was required)
Steps to reproduce the issue
Before:
https://github.com/TheWidlarzGroup/rn-emoji-keyboard/assets/44443723/2429fdf6-147c-4d50-b477-079631511c27
After:
https://github.com/TheWidlarzGroup/rn-emoji-keyboard/assets/44443723/45405415-c44a-4a37-9de2-39ad2129ab5d
Android is functioning ok as well:
https://github.com/TheWidlarzGroup/rn-emoji-keyboard/assets/44443723/44197349-b1be-4231-8bdc-a50194d0bd9f