mlaursen / react-dd-menu Goto Github PK
View Code? Open in Web Editor NEWReact Dropdown Menu
Home Page: http://mlaursen.github.io/react-dd-menu
License: MIT License
React Dropdown Menu
Home Page: http://mlaursen.github.io/react-dd-menu
License: MIT License
I can't get the align property (other than center) to function. Using either right or left option is always left aligned.
Also tested with the Options example and the issue is present there too.
Need to add some sort of delay so that the nested dropdown menu doesn't close instantly if the user accidentally moves the mouse outside of the menus. A good default is 500ms.
Need to have a utility class that creates a separator in the dropdown menu. Needs to be for regular and inverse
idea would just be <li role="separator" className="separator" />
I must be doing something wrong. If I have the close
handler set correctly to set the state of isMenuOpen
to false, then the handler registered on the a
tag in the menu is never called. If I either don't set the close
handler at all (which raises a React error, and breaks functionality) or if I put the setState
in a setTimeout
, it works as expected.
What am I doing wrong?
I want to add a menu to a fixed header. The header CSS is basically:
position: fixed;
top: 0;
left: 0;
height: 60px;
width: 100%;
z-index: 2;
If I try to add a <DropdownMenu>
to an element in the header, most of the menu itself will be hidden because obviously the parent element is only 60px tall.
Is there some mechanism in react-dd-menu
or some workaround to get around this?
I can't use react-dd-menu
with uncontrolled state?
Can I use dataTarget to assign a unique id to each button and corresponding dropdown? or something similar?
If there are multiple nested dropdown menus open, and the entire menu is closed (either moving the mouse off the menu, clicking somewhere on the screen, or the toggle) There is an error "Unable to access componentDidLeave
on null component". This happens with the ReactCSSTransitionGroup.
Solution: Either figure out how to close menus in order from farthest nested up, possibly disable transition for closing, or find some other solution.
This actually causes no problem wioth the menu, would just be nice to eliminate any console error messages..
Leaving width auto, opening to the left, the DD menu content is going outside of the screen on mobile views. Is there an option to make it stop at the screen limit?
Is it possible to change the behavior of the "NestedDropdownMenu" so that it doesn't open on click?
Thanks in advance.
Is there a way to display the menu when I click on the trigger, but have the top-left (or other) corner of the menu at the (x,y) position of the click?
Hi,
I try to use an onClick event for the menu items in my menu, but none of these events ever get fired (console.log('You clicked an item');
)
I tried the exact same code from the example at https://github.com/mlaursen/react-dd-menu but without luck. Any idea why these events are not triggered? Thanks in advance!
Hi, thanks for creating this component!
The only thing I dislike is that it requires me to add an extra dependency to my package.json: react-addons-pure-render-mixin. Also, the React team are now discouraging this in favor of React.PureComponent:
The PureRenderMixin mixin predates React.PureComponent. This reference doc is provided for legacy purposes, and you should consider using React.PureComponent instead.
https://facebook.github.io/react/docs/pure-render-mixin.html
I'd be happy to make a pull request, but PureComponent was only introduced this July in 15.3.0, and so it would cause problems for anyone who hasn't updated React since July, so I guess it would also require a version bump. I was wondering if/how you would like to handle this?
Should probably allow dropdown menus to be nested.So when you hover over a list item that has a nested dropdown, the other dropdown appears. Maybe no animation. Who knows.
Would it make sense to invoke props.close
in componentWillUnmount
? Currently I render x
amount of dropdowns in a component. These dropdowns' open/closed state are kept in global state. These dropdowns can also be arbitrarily removed in real-time via websocket events. When they are removed when they are open, it'll keep its global state as open. By having DropdownMenu
invoke props.close
in unmount I can "circumvent" this.
I can work around this by creating a wrapper component for DropdownMenu
that handles this, but was wondering if you thought it'd be a good idea to keep it in this component?
Should probably allow the menus to be able to appear at the top of the toggle component as well.
Hi, are there any plans to implement check-box functionality on menu items? This is a feature of react-tree-menu, as demonstrated on this demo page. I only ask because the CSS on this library is more attractive and the visibility-toggling of sub-menus looks very clean -- I'd love to use this project, but my goal is to use the nested menus as filters rather than simply navigation.
If working in ES% and you try to
require('react-dd-menu')
,
you don't get the DropdownMenu. You have to specify
require('react-dd-menu').default
.
Hi,
We are looking to upgrade to react 15, but this library doesn't like that as a peer dependency. Any objections to a pull request making that change?
The handleClickOutside
function is not being removed correctly when the component is unmounting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.