When I Press the FAB.Group onPress event not working.
When I press the FAB.Group it should display the log and should change this.state.open so that I can toggle this.state.open on Press.
import React, { Component } from 'react';
import {
View,
} from 'react-native';
import {
FAB, Provider, Portal
} from 'react-native-paper'
export default class ProductDetail extends Component {
constructor() {
super()
this.state = {
open: true,
}
}
render() {
return (
<View style={styles.homeView}>
<FAB.Group
onStateChange={() => {
console.log("State changes")
}}
onPress={() => {
console.log("Pressed")
this.setState((prevState) => ({
open: !prevState.open
}))
}}
open={this.state.open}
icon={this.state.open ? 'calendar-today' : 'plus'}
actions={[
{ icon: 'plus', onPress: () => console.log('Pressed add') },
{
icon: 'star',
label: 'Star',
onPress: () => console.log('Pressed star'),
},
{
icon: 'email',
label: 'Email',
onPress: () => console.log('Pressed email'),
},
{
icon: 'bell',
label: 'Remind',
onPress: () => console.log('Pressed notifications'),
},
]}
/>
</View>
)
}
}
FAB.Group in Providerand Portalbut it changes the zIndexand FAB.Group goes under the other components.TouchableOpacityso i can use its onPressattribute but it also makes FAB.Group to go disappear. | software | version
| ----------------------- | -------
| android | 10
| react-native | 0.63.2
| react-native-paper | 4.2.0
| node | 12.16.3
| npm | 6.14.4
|react-native-vector-icons|7.1.0
Couldn't find version numbers for the following packages in the issue:
react-native-vector-iconsexpoCan you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
react-native (found: 0.63.2, latest: 0.63.3)npm (found: 6.14.4, latest: 6.14.8)Can you verify that the issue still exists after upgrading to the latest versions of these packages?
Couldn't find version numbers for the following packages in the issue:
expoCan you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
react-native (found: 0.63.2, latest: 0.63.3)npm (found: 6.14.4, latest: 6.14.8)Can you verify that the issue still exists after upgrading to the latest versions of these packages?
I am not using expo, I am using react-native-cli & also react-native and npmversions are almost same
Sorry to bother, I just placed FAB at the end of the component and its working now.
Most helpful comment
Sorry to bother, I just placed FAB at the end of the component and its working now.