React-native-paper: The visible props from fab.group only works 1 time

Created on 1 Feb 2019  路  2Comments  路  Source: callstack/react-native-paper


Current behaviour

I am trying to display and hide a fab.group. When I tried the first time It is works, I can hide the fab and display it again. But when I try again, I can not hide it

Expected behaviour

Being able to hide the fab more than once

Code sample

_callOtherview( ) {
this._hide();
Actions.comment({ changeState: this._display }); // I am using to change the current view with 'react-native-router-flux'
}

_display = () => {
this.setState({
displayButton: true,
});
}

_hide = () => {
this.setState({
displayButton: false,
});
}

render () {
return(

visible={this.state.displayButton}
open={this.state.open}
icon={require( '../../../src/favicon.jpg')}
actions={[
{ icon: 'camera', label: 'Foto', onPress: this._selectPhoto },
{ icon: 'comment', label: 'Comentario', onPress: this._sendComment },
]}
onStateChange={({ open }) => this.setState({ open })}
onPress={() => {
if (this.state.open) {
// do something if the speed dial is open
}
}}
/>

)
}

Screenshots (if applicable)

What have you tried

I checked if the state is well implemented and also I tried to implement the fab by another way, somithing like this:

if (this.state.display) {
return
} else {
return null
}

But I had the same problem

Your Environment

| software | version
| --------------------- | -------
| ios or android | android
| react-native | 0.55
| react-native-paper | 2.7
| node | 10.13
| npm or yarn | 6.4.1
| expo sdk |

needs repro

Most helpful comment

@Kevinmenar can you try this? for me it's working fine.
can you reproduce a issue and share the link?

All 2 comments

@Kevinmenar can you try this? for me it's working fine.
can you reproduce a issue and share the link?

@Kevinmenar , is it still valid issue? If yes please provide a snack with reproducible bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makhataibar picture makhataibar  路  4Comments

ButuzGOL picture ButuzGOL  路  3Comments

ZhengYuTay picture ZhengYuTay  路  3Comments

mihaidaviddev picture mihaidaviddev  路  3Comments

ButuzGOL picture ButuzGOL  路  4Comments