-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set menu position always bottom? #102
Comments
@crusherblack did you find a way to do this? |
I am running into the same issue using zeego which uses this library for ios. I found that rendering a separate preview of the same content will keep the menu on the bottom, but introduces a small flicker: nandorojo/zeego#107. I've been poking around the source code to see if I can find a way to keep the menu on the bottom without the flicker, but no luck so far. |
After digging around a bit more I found that commenting out the
|
@acdifran hello, thank you for the detailed response and for bumping this issue i apologize for responding so late, this issue kind of got buried in my emails (so this is the first time i am seeing this) to start things of, i need to make a test to repro this; can i ask what version of the library you are using? unfortunately, i can only work on a fix for this in the latest pre-release major version i might be able to backport it though if it's relatively simple |
hey @dominicstop thanks for looking into this! I am on 2.5.1. I tried upgrading to v3, but seems it is not set up to work with expo, is that right? |
@acdifran hello, yes unfortunately i haven't tested it with expo yet; i just haven't had the time to do it since i'm no longer doing OSS for the time being. the scaffolding + example app for if you happen to know how, i would be grateful if you could help me set that up, so i can continue testing; here's a testfllight version of the example app just in case you need it (i think it might have gotten fix during the rewrite): https://testflight.apple.com/join/VsNeSTPq i think it should still work with zeego, since i haven't really changed much of the API (though i did remove some of the internal cleanup stuff). if you have time, can you please try installing: Edit: Hello, i added an example for expo, and it seems to work just fine. please reply w/ min. example code to reproduce this bug so i can investigate; thank you |
hey @dominicstop just seeing your latest message above, thanks for putting up an expo example. I added a second example where the preview is the same as the main content where you can see the flicker. ScreenRecording_11-08-2024.09-09-35_1.MP4here's the code for the new example: export function FlickerExample({ children }: { children: React.ReactElement }) {
return (
<ContextMenuView
style={styles.menuContainer}
previewConfig={{ previewType: "CUSTOM" }}
renderPreview={() => children}
menuConfig={{
menuTitle: "BasicUsageExample01",
menuItems: [
{
actionKey: "key-01",
actionTitle: "Action #1",
},
{
actionKey: "key-02",
actionTitle: "Action #2",
},
{
actionKey: "key-03",
actionTitle: "Action #3",
},
],
}}
>
{children}
</ContextMenuView>
);
}
export default function App() {
return (
<View style={styles.container}>
<StatusBar style="auto" />
<BasicUsageExample01 />
<FlickerExample>
<Text style={styles.text}>Press And Hold To Show Context Menu</Text>
</FlickerExample>
</View>
);
} |
hey @dominicstop wondering if you ever got chance to check this out. thanks! |
hello, i'll take a look edit: the reason why it "flickers" is because you're displaying the same thing in the preview + context menu body. |
yeah I get that, but as mentioned above showing the same thing in the preview is the only way to have the menu always appear on the bottom. Without a custom preview the menu will appear on top if the item is near the bottom of the screen while a custom preview will move the preview up towards the center so the menu can still show on the bottom. If I comment out all the code at the bottom of Explained in more detail in this comment above: #102 (comment) |
i understand your frustration—but in order to fix this, i would have to impl. some entrance and exit animations for the custom preview, and for it not to break other things it has to be configurable (e.g. entrance and exit keyframe). unfortunately, this library has been in maintenance mode for a while now, and i can't really add new features like that anymore—especially since this is just something i do in my free time (the fact that this library works in the new arch. at all took a monumental effort to do). the best i can do is to recommend that you add some "animated" code to fade in and out the custom preview. if you have the free time, you can submit a PR to fix this specific use case—or if you have the funds, you can commission a feature for the community (that would be nice, but understandably the least likely option). alternatively, if you're comfortable w/ writing some swift code (and want a less hacky solution), you can make a quick patch for your app (via something like patch-package, or a custom fork that you maintain):
thank you for being patient with me—but this is the best i can do for now (maybe in the future, i can add an official fix) |
@dominicstop I completely understand, thanks for the info and your help on this so far. For now I have patched on my end to comment out the |
Hi i want to set the menu position to bottom only so the aux preview not overlapping each others
I want it to be like this everytime hold the item
Can you help me?
Thank you
The text was updated successfully, but these errors were encountered: