question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgraded from 0.4.1 to 0.5.1 and menu is not shown anymore if absolute position is used

See original GitHub issue

Hello there, I have just upgraded from 0.4.1 to 0.5.1 but now the menu is not shown anymore if the absolute position is used. The following component is passed to another component like children (to a custom Video Player)

<View
                style={
                    position: "absolute",
                    top: 0,
                    bottom: 0,
                    left: 0,
                    right: 0,
                    width: 40,
                }
>
                <MenuView
                    isAnchoredToRight={true}
                    onPressAction={({ nativeEvent }) => {
                        if (isDisabled === true) {
                            return;
                        }

                        switch (nativeEvent.event) {
                            case EnumItemActions.duplicate:
                                event.duplicateItem({id: item.id});
                                break;
        
                            case EnumItemActions.sendToEvent:
                                setItemToSend(item.id);
                                break;
        
                            case EnumItemActions.delete:
                                setItemIdToDelete(item.id);
                                break;
                        }
                    }}
                    actions={isDisabled === false ? [
                    {
                        id: EnumItemActions.duplicate,
                        title: 'Duplicate',
                    },
                    {
                        id: EnumItemActions.sendToEvent,
                        title: 'Send to Event',
                    },
                    {
                        id: EnumItemActions.delete,
                        title: 'Delete',
                    },
                    ] : []}
                >
                    <Icon
                        name="more-vert"
                        containerStyle={{ alignSelf: "center" }}
                        disabled={isDisabled === true}
                        color={iconColor}
                    />
                </MenuView>
</View>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
openswcommented, Jul 16, 2021

Hi, from here you can play with a demo https://github.com/opensw/BugDemoReactNativeMenu

In 0.4.1 the menu is working, in 0.5.1 it is not working. The project is configured for Android, for iOS you need to install https://github.com/oblador/react-native-vector-icons (just drag and drop the required fonts on Xcode like described in the installation section).

Please, do not remove any components from the code (style too), some of them seem useless but in my real code they are used for other stuff (it is just to give you the exact code structure that I am using in my real code).

How to upgrade:

  • Stop metro on your development machine
  • Uninstall the App from your phone
  • Change in package.json the “@react-native-menu/menu”: “^0.4.1” to “@react-native-menu/menu”: “^0.5.1”
  • Use my script install.sh
  • Start metro on your development machine npm start -- --reset-cache
  • Start the app like usually npx react-native...

Screenshot_20210716-090031_DemoReactNativeMenu Screenshot_20210716-090736_DemoReactNativeMenu

0reactions
openswcommented, Jul 16, 2021

Hi @mateusz1913 , I had updated the repo with react-native-safe-area-context. On my Samsung A21s, the issue persists. I will try in the next few days to debug better what is going on.

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Absolute position is not working - Stack Overflow
My element's nth-parent has a position other than the default, but I need my element to be placed absolutely on top left of...
Read more >
Less Absolute Positioning With Modern CSS - Ahmad Shadeed
When we have a card that contains text over an image, we often use position: absolute to place the content over the image....
Read more >
Changelog - DropIt
... destination (read 4.4 of the Guide) - fixed issue of absolute links in HTML lists - fixed issue of option to ignore...
Read more >
Code 2022.3.0 Beta - NVIDIA Omniverse Documentation
The new format store absolute time instead of frame for keys ... A bug that newly added curves not shown in prim panel....
Read more >
boost-releases/readme.md at master - GitHub
Implement Spellchecker experementally. · Overhaul menu items. · Show warning when trying to print snippets. · Update Japanese locales. · Highlight folders when ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found