Skip to content
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

Component: BottomNavigation onTabSelect() behaviour #977

Closed
SandroDahl opened this issue Mar 31, 2020 · 2 comments · Fixed by #1055
Closed

Component: BottomNavigation onTabSelect() behaviour #977

SandroDahl opened this issue Mar 31, 2020 · 2 comments · Fixed by #1055

Comments

@SandroDahl
Copy link

💬 Question

bottomNavigation.component.tsx:125

private onTabSelect = (index: number): void => {
    if (this.props.onSelect && this.props.selectedIndex !== index) {
      this.props.onSelect(index);
    }
};

Is there any reason why onSelect() is only allowed to call if the selected index is not equal to the current index.

I would like to listen to this event, even if it is the same index, so I can refresh my tab content (scroll view to top).

Or do I miss something and can solve it differently?

UI Kitten

Package Version
@ui-kitten/components v4.4.1
@artyorsh
Copy link
Collaborator

@SandroDahl my vision was we don't need to handle this. Most cases assume changes in navigation state with this event, so this is why this condition was added. Not sure, but as far as I remember adding onPress for BottomNavigationTab can solve your case. Pleas try it and comment if it does.

@SandroDahl
Copy link
Author

An added onPress function on BottomNavigationTab is also not called. But I can use an added onPressIn or onPressOut function as workaround for now.

@artyorsh artyorsh mentioned this issue Apr 25, 2020
2 tasks
@artyorsh artyorsh linked a pull request Apr 26, 2020 that will close this issue
2 tasks
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 a pull request may close this issue.

2 participants