FAB not responding if at least once disabled [working with RN 0.59.8 but not with 0.60.4]
See original GitHub issueIf problematically set disabled
prop to false then afterwords the FAB never responds with disabled={true}
. FAB is greyed out properly according to whether disabled or not but completely freezes if once disabled.
TRIED WITH MULTIPLE PROJECTS USING RN 0.60.4 - GOT SAME RESULTS
Here is my code:-
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
Button,
Alert
} from 'react-native';
import { FAB } from 'react-native-paper';
export default class FabComponent extends Component {
state = {
disableFab: false
}
handleFabPress = () => {
Alert.alert(
'Alert Title',
'You pressed the floating button',
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{cancelable: false},
);
}
render() {
return (
<View style={styles.container}>
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Button
onPress={() => {
this.setState((prevState) => {
return {
disableFab: ! prevState.disableFab
}
})
}
}
title={this.state.disableFab? 'Enable FAB' : 'Disable FAB'}
color="#488c51"
/>
</View>
<FAB
style={styles.fab}
small={false}
icon="add"
disabled={this.state.disableFab}
onPress={this.handleFabPress}
/>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
fab: {
position: 'absolute',
margin: 16,
right: 0,
bottom: 0,
},
});
the repo is here - https://github.com/devsrv/rnpaper-fab
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
floating action button on react native - Stack Overflow
I want to use a floating action button in react native android in bottom right corner of the screen. But I am not...
Read more >Full text of "The U.S. Naval astronomical expedition to the ...
Full text of "The U.S. Naval astronomical expedition to the southern hemisphere, during the years 1849-'50-'51-'52;". See other formats.
Read more >React Floating Action Button (FAB) component - Material UI
A floating action button appears in front of all screen content, typically as a circular shape with an icon in its center. FABs...
Read more >Words 219k | PDF - Scribd
25 but 4603799 414960 0.36 659768 598168 590466 729227 35 my 3107804 258460 0.15 457496 367843 871337 297289 45 if 2710989 359865 0.33...
Read more >Senior Software Engineer, React Native - at hims & hers
A "disabled veteran" is one of the following: a veteran of the U.S. military, ground, naval or air service who is entitled to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@devsrv Paper v3 uses
react-native-vector-icons/Material-Community-Icons
instead ofreact-native-vector-icons/Material-Icons
by default so you need to update name of the icon or use old Icon component via settings prop on PaperProvider. You can see how to do it hereHello @devsrv! Can you please try upgrade react-native-paper to 3.0.0-alpha.3? My fix touchable-ripple-toggling-disable-prop was merged there
The problem occurs with RN > 0.60, There were some changes with accessibility 0.59 -> 0.60 and they causing this issue.