Giter Site home page Giter Site logo

Comments (5)

anasmi avatar anasmi commented on September 21, 2024

Hi @sirbris,

I have tried today to reproduce the issue using the demo within the add-on, but I haven't managed so far. My steps were:

  • open context-menu
  • navigate using arrow key up/down. This way there were no skipping the line occurrences.

Therefore, could you, please, share the demo application which illustrates the problem? Or, if it's not possible, to share gif/picture and describe your actions, that we would be able to reproduce the problem on our side also,

Thanks in advance!

from context-menu.

sirbris avatar sirbris commented on September 21, 2024

Here's a simple example:

  • open context menu on the grid
  • press key down
    public class TestBean {
        private String name = "name";
        private String value = "value";
        private boolean folder = false;

        public TestBean(boolean inFolder) {
            folder = inFolder;
        }

        public String getName() {
            return name;
        }

        public void setName(String inName) {
            name = inName;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String inValue) {
            value = inValue;
        }

        public void setFolder(boolean inFolder) {
            folder = inFolder;
        }

        public boolean isFolder() {
            return folder;
        }

    }

    private Grid<TestBean> grid = new Grid<TestBean>(TestBean.class);
    private GridContextMenu<TestBean> contextMenu = new GridContextMenu<>(grid);
    private ArrayList<TestBean> items = new ArrayList<>();

    @Override
    protected void init(VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        setContent(layout);

        grid.setDataProvider(new ListDataProvider<>(items));
        grid.setWidth("100%");
        grid.setHeight("400px");

        layout.addComponent(grid);

        contextMenu.addContextMenuOpenListener(event -> handleOpen(event));
    }

    private void handleOpen(ContextMenuOpenEvent inEvent) {
        contextMenu.removeItems();
        contextMenu.addItem("test1", event -> System.out.println("clicked 1"));
        contextMenu.addItem("test2", event -> System.out.println("clicked 2"));
        contextMenu.addItem("test3", event -> System.out.println("clicked 3"));
        contextMenu.addItem("test4", event -> System.out.println("clicked 4"));
        contextMenu.addItem("test5", event -> System.out.println("clicked 5"));
    }

from context-menu.

anasmi avatar anasmi commented on September 21, 2024

Thanks for the example! :)

Just to be sure, what version of Vaadin are you using?

I have tried to run the demo under context-menu itself, and everything works as expected; also it seems that it works alright in 8.1.7, but 8.4.3 produces already the behavior you see. Therefore, it looks like some change in the framework has affected the work of the addon, but it will require more investigation to be sure, of course.

from context-menu.

sirbris avatar sirbris commented on September 21, 2024

I use the current Vaadin 8.4.3 and also the current ContextMenu 2.1.0

from context-menu.

anasmi avatar anasmi commented on September 21, 2024

alright, thanks! : )

from context-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.