onPress not detected on position: absolute element inside Menu's anchor property
See original GitHub issueOnPress not working on position absolute element inside Menu anchor
I have a FAB button(the purple button in the image above with the horizontal menu icon) that has a position: absolute and it is inside a Menu element. The onPress event is not triggered when it is inside the Menu’s anchor property. If I change the FAB’s position to relative then the onPress events are triggered.
Code
<Menu
visible={this.state.profile_edit_menu_visible}
onDismiss={this._dismissProfileMenu}
anchor={
<FAB
icon="dots-vertical"
color="#FFFFFF"
small
style={styles.infoBtn}
onPress={() => {
console.log("Pressed...");
this._showProfileMenu();
}}
/>
}
>
<Menu.Item ... />
<Menu.Item ... />
</Menu>
I am not able to get this working in any way. I don’t want to change it to a normal button, so appreciate any workarounds and suggestions. Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
when div with absolute position is added cannot click on links
As The Div is absolutely positioned over the links and hence it is not allowing clickability. #left_border { background-image: url(http://tax.
Read more >Position element at the bottom of the screen using Flexbox in ...
In this post, we go from absolute position to another container, get to know flex , how to add reusable function and how...
Read more >Menu · React Native Paper
Menus display a list of choices on temporary elevated surfaces. Their placement varies based on the element that opens them.
Read more >Controlling tooltips & pop-up menus with components in React
Use compound components to control tooltips and pop-up menus in your React ... Position the tooltip relative to the selected element; Detect ......
Read more >CSS Z-Index Not Working? How to Fix It Using Stack Order
The z-index property of CSS is a tricky one. It won't work easily by itself if you don't know how to use it...
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
Very late to this, but I wrapped my entire
Menu
in aView
and gave theView
absolute positioning and it fixed this for me.Hi I solved my problem, are you trying to change the z-index property of its FAB?