Multiple Popovers opening in sequence, second not opening when triggered by button in first
See original GitHub issueSorry for my bad English. I want to use react-native-popover-view as a guide for new user. If user read the first guide and they click “Ok” it will open the second guide. My code is below. Thank you for your help ! “react-native-popover-view”: “version”: “1.0.9”, “react-native”: “version”: “0.57.4”,
export default class App extends Component<Props> {
componentDidMount() {
this.setState({ isVisible: true });
}
state = {
isVisible: false,
isVisible2: false
};
showPopover() {
this.setState({ isVisible: true });
}
showPopover2() {
this.setState({ isVisible2: true });
this.setState({ isVisible: false });
}
closePopover() {
this.setState({ isVisible: false });
}
render() {
return (
<View style={styles.container}>
<Popover
isVisible={this.state.isVisible}
fromView={this.touchable}
onClose={() => this.closePopover()}
>
<Text style={styles.test}>The first guide</Text>
<TouchableHighlight
style={styles.button}
onPress={() => this.showPopover2()}
>
<Text>go to second</Text>
</TouchableHighlight>
</Popover>
<Popover
isVisible={this.state.isVisible2}
fromView={this.touchable2}
onClose={() => this.closePopover()}
>
<Text style={styles.test}>The second guide</Text>
<TouchableHighlight
style={styles.button}
onPress={() => this.showPopover()}
>
<Text>Press me</Text>
</TouchableHighlight>
</Popover>
<TouchableHighlight
ref={ref => (this.touchable = ref)}
style={styles.button}
onPress={() => this.showPopover()}
>
<Text>Press me</Text>
</TouchableHighlight>
<Text
ref2={ref2 => (this.touchable2 = ref2)}
tyle={styles.instructions}
>
text 1
</Text>
</View>
);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Popovers not showing up on first click but ...
The problem is when I click on the tips-icon.png button, the popover doesn't show up on first click (I guess it's because I...
Read more >Popovers
When triggered from anchors that wrap across multiple lines, popovers will be centered between the anchors' overall width. Use white-space: nowrap; ...
Read more >ion-popover
ion-popover is a dialog that appears on top of the current page. Learn about the popover UI component and CSS custom properties for...
Read more >Bootstrap popovers
Use the focus trigger to dismiss popovers on the user's next click of a different element than the toggle element. Specific markup required...
Read more >Popover API (Explainer)
Popovers (of a particular type) are generally "one at a time" - opening one popover closes others. This document proposes a set of...
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
I’m considering making a change to the popover code to make this easier, which would detect when there is a modal open and then delay the second popover from trying to show until the first is closed… so you are welcome to wait for that update, but no guarantee on timing.
It’s work. Thank you very much @SteffeyDev.