Skip to content
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

Can we make the menu fixed at the bottom of the screen? #62

Open
rmscoelho opened this issue Jun 24, 2019 · 4 comments
Open

Can we make the menu fixed at the bottom of the screen? #62

rmscoelho opened this issue Jun 24, 2019 · 4 comments

Comments

@rmscoelho
Copy link

Good evening,

I am trying to make the menu always open in the same position, because I am having trouble with it opening over the last item of a loop, instead of on top of the clicked item.

If there is a solution, I'd be pretty grateful.

Thank you!

@mxck
Copy link
Owner

mxck commented Jun 24, 2019

@rmscoelho at the moment this is not possible.
In near future I want rework this component in small one like overlay and menu and you can build own menu from this components and configure them separately (that also close #54).

For temporary fix you can modify that line to set menu position from props (or use hardcoded constants). Like this:

  show = () => {
    this.setState({
      buttonHeight: 0,
      buttonWidth: 0,
      left: this.props.left,
      menuState: STATES.SHOWN,
      top: this.props.top,
    });
  };

Also you need remove padding from constants in render method.

@rmscoelho
Copy link
Author

rmscoelho commented Jun 24, 2019

@mxck Thanks man!
I ended up finding a fork of your work, that worked in a different way and so didn't give me problems with the way I was doing stuff (which is probably very very wrong).

But keep going, this is pretty good stuff, good potencial! I like those ideas of yous ;)

@likern
Copy link

likern commented Sep 5, 2019

@rmscoelho You can try out this package - https://www.npmjs.com/package/react-native-enhanced-popup-menu. It initially was based on this react-native-material-menu, but more flexible in terms of customizations.

I support not only bottom position, but BOTTOM_LEFT, BOTTOM_RIGHT, BOTTOM_CENTER. And on top of that you can add your custom dynamic position shifts (offsets). It allows you to place menu virtually everywhere.

@rmscoelho
Copy link
Author

@likern I think we ended up using that one. Not sure now, it was 3 months ago already ahahah
But we managed to do it, it's what matters.

Many thanks anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants