FAB doesn't collapse properly in iOS
See original GitHub issue“react”: “16.0.0-alpha.12” “react-native”: “0.48.1” “native-base”: “2.3.6” iOS 11
Actual behaviour
Using FAB in iOS, when clicking on child button and then change the FAB’s “active” to false, all buttons collapses except last one. (Note that there’s no problem when clicking on the actual FAB button to expand/collapse. The problem is just when trying to collapse everything by clicking on a child button)
Code
` import React, { Component } from ‘react’; import { View } from ‘react-native’; import { Fab, Icon, Button, Container, Content } from ‘native-base’;
class TmpScreen extends Component {
constructor() {
super();
this.state = {
active: false
};
}
render() {
return(
<Container>
<View style={{flex: 1}}>
<Fab
active={this.state.active}
direction="up"
position="bottomRight"
containerStyle={{ }}
style={{ backgroundColor: 'black' }}
onPress={() => this.setState({ active: !this.state.active })}
>
<Icon name="add"/>
<Button
style={{backgroundColor: 'grey' }}
onPress={() => this.setState({ active: !this.state.active })}
>
</Button>
<Button
style={{backgroundColor: 'green'}}
onPress={() => this.setState({ active: !this.state.active })}
>
</Button>
<Button
style={{backgroundColor: 'red'}}
onPress={() => this.setState({ active: !this.state.active })}
>
</Button>
</Fab>
</View>
</Container>
)
}
} `
Steps to reproduce (code snippet or screenshot)
- Click on FAB
- Click on one of its children buttons
Screenshot of emulator/device
Is the bug present in both ios and android or in any one of them?
It’s working on Android.
Any other additional info which would help us debug the issue quicker.
Yes. If i make the direction ‘left’, the it’s working on iOS !!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Buttons: floating action button - Material Design
A floating action button (FAB) represents the primary action for a screen.
Read more >collapse! Is the iPad and iPhone broken and black screen broken ...
The iPhone and iPad screens are all black, the touch screen does not respond ... “Hey, Siri, close the narration” → you can...
Read more >Android: Expand/collapse animation - Stack Overflow
I took @LenaYan 's solution that didn't work properly to me (because it was transforming the View to a 0 height view before...
Read more >ion-header - Ionic Framework
This can be done by adding two headers, one above the content and one inside of the content, and then setting the collapse...
Read more >Collapse button NavigationView SideBar SwiftUI
I could not find a simple way to hide Collapse button on navigation bar. Also, as far as I checked the UI design...
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
@minaskamel As a workaround you can try this
Code
Gif
it worked for me with little changes; you should use
this._fab._root.state.active