Closed Ambrosiani closed 6 years ago
@RubenSandwich hopefully you can help me out here :)
@Ambrosiani So the code for the onPress you tried was:
if (this.refs.SEARCH_REF != null) {
this.refs.SEARCH_REF.popToTop();
return;
}
this.props.actions.updateActiveTab(TAB_SEARCH);
Yeah, that should work... I'll look into it.
exactly!
@Ambrosiani I figured it out:
if (this.refs.SEARCH_REF != null) {
this.refs.SEARCH_REF.popToTop();
}
this.props.actions.updateActiveTab(TAB_SEARCH);
We forgot, to remove the return;
so the updateActiveTab was never called. 🤦🏽
I pushed this change: https://github.com/NordicMuseum/Nordic-Museum-Audio-Guide/commit/baa0d74000ad0c296e805c1baba0ee33ba2da27d
thank you 🥇
https://github.com/NordicMuseum/Nordic-Museum-Audio-Guide/blob/baaf29e0956c21264dea97c08413d3cf77294a20/app/components/rootScreen.js#L156
right now popToTop is only done if the search tab is already selected. how do I change the onPress function so that popToTop is called the first time the tab item is pressed as well?
(I tried removing
this.props.activeTab === TAB_SEARCH &&
but to no avail)