Giter Site home page Giter Site logo

Comments (17)

isaacplmann avatar isaacplmann commented on May 18, 2024 1

This has been implemented in 1.2.0

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

Which specific element should the focus be applied to? The <ul>, the first <li>, or the <a>/<span> inside the first <li>?

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

I think the focus should apply to <ul>

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

I tested yours changes here(https://isaacplmann.github.io/ngx-contextmenu/). But up and down keys don't work for navigation inside the context menu.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

Correct. To navigate with the keyboard, you need to use tab, shift-tab, enter and esc. I spent about a half hour trying to get arrow keys to work and then backed out those changes because it was getting really complicated.

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

I understand. Do you plan to do this navigation in the future?

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

Probably not. Unless I figure out how to do it in a simple and maintainable way. tab and shift-tab work by using the browser's built in mechanism for changing focus - which I couldn't figure out a way to tap into.

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

@isaacplmann
I prepared pull request with navigation inside context menu #35
In my opinion, after merging this changes autofocus should be removed.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

Thanks for the contribution! I'll take a look.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

PR #35 is incorporated into version 1.3.0.

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

When using context menu with Bootstrap 4, class 'active' don't apply to item inside a menu. I found that you use bootstrap 3. The workaround for Bootstrap 4 is below:

body {
  context-menu-content {
    .dropdown-menu {
      .active {
        .dropdown-item {
          color: #fff;
          text-decoration: none;
          background-color: #0275d8;
        }
      }
    }
  }
}

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

It looks like bootstrap 4 expects .dropdown-menu to have child .dropdown-items that then have .active class applied to them. I'm missing the .dropdown-item class. I'll add that to the template.

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

There are used .dropdown-item:active for styling item

from ngx-contextmenu.

Yura13 avatar Yura13 commented on May 18, 2024

Also, focus and navigation are async. Tabbing through disabled item is correct flow, or not.

image

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

Yes, I don't plan to try to synchronize tab focus and the keyboard navigation. This way you can tab through available links just like normal - I'm not hijacking the tab key at all.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

If you don't like the focus, just turn off autoFocus.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 18, 2024

This should be fixed in 1.3.1

from ngx-contextmenu.

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.