Giter VIP home page Giter VIP logo

react-menu-list's People

Contributors

dependabot[bot] avatar kikketer avatar macil avatar mnbuhl avatar omarstreak avatar raoulj avatar wegry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-menu-list's Issues

Customize dropdown container

It is not possible to add any styles or classes to the very first wrapper of dropdown menu. I`m having an issue, when I need to change menu zIndex, because it is hidden by page contents

auto call onWillClose() at first click MenuButton issue

When I click MenuButton at first, menu popup will be auto closed. And then I click MenuButton again, it will be working well. But I don't know where trigger onWillClose function.
And could you please give a detailed demo for ButtonComponent of MenuButton. Thanks.
My coding as below,
<MenuButton menu={ <div className='multi-level-menu-list-container'> { this.renderSub() } </div> } onWillOpen={ this.onWillOpen } onDidOpen={ this.onDidOpen } onWillClose={ this.onWillClose } > <Button type='button'> Btn </Button> </MenuButton>

toggle does not work

Toggle does not work, react 16.6.1
`
class Header extends React.PureComponent {
render() {

    return (
        <div>
            <button onClick={() => {this.menuButton.toggle();}} >
                toggle menu
            </button>

            <MenuButton
                ref={(elem) => { this.menuButton = elem; }}
                menu={
                    <Dropdown>
                        <MenuList>
                            <LI>Mercury</LI>
                            <LI>Neptune</LI>
                            <LI>Neptune</LI>
                            <LI>Neptune</LI>
                            <LI>Neptune</LI>
                        </MenuList>
                    </Dropdown>
                }
            >
                Menu Button
            </MenuButton>
        </div>
    );
}

}`

Uncaught error at Object.onRightPushed on "right arrow key" click on the subMenuItem

Code sandbox Link: https://codesandbox.io/s/eloquent-browser-mzpok?file=/src/App.

steps to reproduce the issue:

  1. Focus on menu list
  2. Click on down arrow key to navigate the subMenuItem
  3. Click on Right arrow key to open sub menu,

Issue: Getting the error "Uncaught error at Object.onRightPushed"

Please refer to the attached screen shots

Note1: it's working file with mouse hover
Note2: it's reproducible with older version "6.1.1" as well

subMenuError1

j

subMenuError2

s

Option to render menu with display:none when closed?

Hello and thank you for this library!

I have built a menu with submenus using react-menu-list which contains links to other places on my web app. I would like these links to be visible to google crawlers, but at present the menu doesn't exist in the DOM until it's clicked.

Could there be an option so that menu and submenus are always rendered to the DOM, albeit with display:none when the menu is closed? (I.e. same as how reactstrap renders dropdowns.)

(FYI my submenus are only one level: i.e. the parent menu has multiple submenus, but no submenu has submenus.)

Perhaps I could have a go at this myself, but I'd greatly appreciate any insight you might have.

ButtonComponent prop Capitalised

Hello! I found that you use ButtonComponent prop instead of buttonComponent that I and many others would expect. Is it on purpose?

Styling parent div.

I've a list that runs past the length of the screen, and I can't get any sort of scroll functionality to work as I don't have access to the parent div's class:

image

Is there a way to allow me to access that? I'd thought "openedClassName" would do it, but it only affects the menu button and not the generated menu. Adding a height style to the Dropdown doesn't work. If there's a better solution to allow access to the items that are off the page, I'd love to hear that as well.

Better Dropdown/MenuButton API

I think the current API for making a dropdown opened by a menubutton is suboptimal for a few reasons:

  • A user may think to themselves "I want a dropdown opened by a button. Okay, step 1 is that I need to find a 'dropdown' component, and step 2 is that I need to find a 'button' component to use with it." ReactMenuList currently abstracts things oppositely: The user needs to use the MenuButton component, which handles opening and positioning of a dropdown, and then the user passes a Dropdown component to MenuButton's menu prop. If the user reaches for a "dropdown" component first before thinking about buttons, then they're going to get lost.
  • I'm not really happy with MenuButton's ButtonComponent prop. Passing components in a prop is awkward and unintuitive:
    • It can encourage more components to be created than necessary.
    • Users often don't realize how they can pass extra props to the ButtonComponent (define a stateless functional component within the main component which passes some props from the main component to the button component, and pass that as ButtonComponent instead).
    • If a user passes an inline SFC as ButtonComponent then it will re-render from scratch on each render and lose state.

Some things to keep in mind for a new API for dropdowns:

  • The API should be naturally usable (or implementable) by SubMenuItem too.
  • Can the Dropdown API be split from the ReactMenuList project? (Should it be part of ReactFloatAnchor?) Is this Dropdown API actually an improvement over ReactFloatAnchor?
  • Could the new API make use of React Hooks instead? Can React Hooks avoid the need for component or render props here?

Version of MenuButton that allows focus to be inside dropdown needed

Currently, MenuButton closes as soon as the focus leaves the button. However, this doesn't work out if you have a text field (like a search box) inside of the dropdown menu that you want to be focused and usable.

MenuButton works pretty simply and dependably; I'm not really sure I want to change the blur-closes-dropdown behavior of it. Maybe another component like MenuButton should be made that closes when it sees something outside of it get clicked or focused. It also needs a name. FocusableDropdownMenuButton? Not great.

Should investigate what other websites and menu libraries do. From experimenting, Gmail does appear to have two different types of menu buttons like this, which is reassuring.

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.