akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.28k stars 951 forks source link

Top Navigation Controls mutli-press #577

Closed Farangi closed 5 years ago

Farangi commented 5 years ago

I was using the top-navigation controls, and i noticed that if you press a navigation-control multiple times, it generates multiple events simultaneously.

I was opening a modal with a top-navigation control, and if you press it multiple times, it opens multiple modals, which are unable to close later on, and it causes the application to get stuck.

Is there a workaround to that? Or is there anyway i could disable the navigation control after the first press event?

32penkin commented 5 years ago

Hi @Farangi ! Thanks for your reply. Could you please share the code example with us, it seems to me that I know the issue but just want to make sure.

artyorsh commented 5 years ago

@Farangi you just need to apply throttle effect to prevent such issues. This is not a framework issue, but it is well known in frontend development. Check lodash.throttle