Code Monkey home page Code Monkey logo

Comments (6)

kentcdodds avatar kentcdodds commented on August 18, 2024 2

Fixed it locally. Making a PR now. Thanks!

from downshift.

kentcdodds avatar kentcdodds commented on August 18, 2024

I think that one of the requirements of using this is that when you apply any of the get props functions you must forward all the props regardless of what those props are. I can't think of any way to avoid doing this, even with a data-item-id type thing. These properties need to make it to the DOM whether it's a data-item-id or an id prop. I'm not sure what you mean by:

We could walk up the dom tree to the nearest id attribute (maybe use data-item-id) instead.

Could you clarify?

from downshift.

kentcdodds avatar kentcdodds commented on August 18, 2024

One thing that I think we could do is document the requirement a little better. While downshift does not have any opinions about how, where, when, or what you render, it does have a strong opinion about what props are applied to the elements you want to hook into the downshift context.

Does that make sense? Should probably document the importance of that better here (PRs happily accepted)

from downshift.

ferdinandsalis avatar ferdinandsalis commented on August 18, 2024

This would mean you would need to apply the id to every element in the Item (could potentially be many). Also this seems quite error prone.

What I mean when an element is clicked, check if its has the id attribute and if check the parent until you hit the component boundary which should definitely have it. Hope that is clear.

from downshift.

kentcdodds avatar kentcdodds commented on August 18, 2024

Yes, that is clear. I'll fix that now. Thank you!

from downshift.

kentcdodds avatar kentcdodds commented on August 18, 2024
~/Developer/downshift (master)
😎  $ npm publish --tag beta
[email protected]

from downshift.

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.