Code Monkey home page Code Monkey logo

Comments (13)

adriansdev avatar adriansdev commented on July 22, 2024

Nice plugin. Is there a way to trigger openMenu externally?

from react-native-side-menu.

Kureev avatar Kureev commented on July 22, 2024

Thanks for the warm words! I'm thinking about it now, but it doesn't seems to be an easy solution. You need to render menu first to get a reference to it's instance. Since you have a ref, you can call openMenu. I'll try to make an example for that tomorrow.

from react-native-side-menu.

adriansdev avatar adriansdev commented on July 22, 2024

Yes this.refs.{menuid}.openMenu() works fine. thanks

A toggleMenu function is useful for open/close the menu from an external button

toggleMenu:function () {
  if (this.left) {
    this.closeMenu();
  } else {
    this.openMenu();
  }
},

from react-native-side-menu.

chirag04 avatar chirag04 commented on July 22, 2024

@Kureev Can you put up a small example for this? I need to trigger openMenu externally.

Not sure how to handle the ref thing.

from react-native-side-menu.

Kureev avatar Kureev commented on July 22, 2024

Sure, I'll try to make an example asap, but I need some time to figure out about #4

from react-native-side-menu.

chirag04 avatar chirag04 commented on July 22, 2024

Thanks. I would need #4 to be solved anyways. I will also look into the codebase in some time.

from react-native-side-menu.

swennemans avatar swennemans commented on July 22, 2024

@chirag04 landed in this thread to look for info for triggering the openMenu from a button. Not sure if this is what you want, but just in case here is a gist: https://gist.github.com/swennemans/fdaa321fcc02db96de96

Now, lets see how to transition to the next route with navigatorIOS 👍

from react-native-side-menu.

chirag04 avatar chirag04 commented on July 22, 2024

@swennemans Awesome thanks. I would prefer an api exposed by the component itself for this though.

from react-native-side-menu.

Kureev avatar Kureev commented on July 22, 2024

@chirag04 @adrian-social-prod open method has been exposed in 0.3.0 (thanks to @dvcrn)

from react-native-side-menu.

liubko avatar liubko commented on July 22, 2024

property to open menu from the right side will be super usefull

from react-native-side-menu.

Kureev avatar Kureev commented on July 22, 2024

@liubko you mean API to toggle menu? It's already implemented. See #15

from react-native-side-menu.

liubko avatar liubko commented on July 22, 2024
  1. @Kureev no, I mean: ability to position drawer at the right side of the screen
  2. what do you think about adding dragElement like here: http://jakiestfu.github.io/Snap.js/demo/apps/dragElement.html
    because currently SideMenu's responder handles all drag events on the screen, and it breaks my apps functionality.

from react-native-side-menu.

Kureev avatar Kureev commented on July 22, 2024

@liubko Ah, I see:

  • Yes, it's in the roadmap. Unfortunately, I'm busy last month to implement something new, but in theory nothing hard.

  • I think it's a really great idea. I think instead of creating additional layer we can add prop with ref to handler:

    <SideMenu handler={'handler'} menu={<Menu/>}>
      <ListView ref='handler' source={source} />
    </SideMenu>

from react-native-side-menu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.