I am confused by this one - in my app I am setting minToolBarHeight{this.state.toolbarHeight}. My expectation is that this.setState({toolbarHeight: 100}) would cause the toolbar to change to that height but it does not do this. Worth noting that setting a static value in minToolbarHeight{100 // for instance} works as expected.
I have a dummy button whose onPress, for testing purposes, is:
onPress={() =>
this.setState({
toolbarHeight: this.state.toolbarHeight > 0 ? 0 : 100
},
() =>
console.log("Toolbar height: ", this.state.toolbarHeight)
)
}
Hitting the above button will make the toolbar toggle between having 0 and 100 height.
In fact it causes no immediate effect but the next time a message is pushed onto the message stack the toolbar will at THAT point snap to the height in this.state.toolbarHeight.
I am perfectly willing to accept that I am making a basic error here but if I am I am not seeing it and help would be GREATLY appreciated!!
The specific steps I took were:
<GiftedChat
minInputToolbarHeight={this.state.minInputToolbarHeight}
ref={ref => (this.chat = ref)} // <-- important
...
/>
coupled with:
componentDidUpdate(prevProps, prevState) {
if (
prevState.minInputToolbarHeight != this.state.minInputToolbarHeight
) {
this.chat.resetInputToolbar();
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
438 helped me solve this. Feel free to close this but I'm going to leave it open so that anyone trying to find a solution might stumble upon this.
The specific steps I took were:
coupled with: