Giter Site home page Giter Site logo

Comments (4)

jfrux avatar jfrux commented on May 28, 2024

I suppose my real question is... does a "list" have to be "isFocusable" in order for "isWrapping" to work?

from lrud.

thomascgray avatar thomascgray commented on May 28, 2024

Hey @jfrux could you post all your example registerNode calls, and what you expect to happen for a given handleKeyEvent?

Generally speaking, isFocusable should only be set on the nodes that you actually want to have focus, i.e can "hold" a cursor on them. If you wanted, for example, a horizontal list that wrapped, the setup would be along the lines of

const navigation = new Lrud();

navigation.registerNode('root', { orientation: 'horizontal', isWrapping: true })
    navigation.registerNode('child_1', { parent: 'root', isFocusable: true })
    navigation.registerNode('child_2', { parent: 'root', isFocusable: true })
    navigation.registerNode('child_3', { parent: 'root', isFocusable: true })

Now, if you assign focus on child_3 and handle a key event for the direction of "right", you should find your focus landing on child_1. Does this help?

from lrud.

jfrux avatar jfrux commented on May 28, 2024

from lrud.

thomascgray avatar thomascgray commented on May 28, 2024

Closing this issue as there has been no activity for a couple of weeks. If you're still having problems with this, feel free to open a new issue 👍

from lrud.

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.