Code Monkey home page Code Monkey logo

Comments (3)

LFDanLu avatar LFDanLu commented on September 24, 2024

Can you try accessing the TreeStateContext from within UNSTABLE_TreeItemContent/the checkbox instead? I imagine you should be able to override the onChange for the Checkbox at that point to reach your desired behavior then. However, if you want interactions on the Tree row itself to also follow the same behavior, that might be a bit trickier, might have to drop down to the hooks level to fully customize that behavior

from react-spectrum.

nathanforce avatar nathanforce commented on September 24, 2024

It looks like I'm able to access the state via context from within my Checkbox component. Thanks!

Do you know if there is appetite to include this parent selection behavior out of the box? It feels pretty standard for a tree component and might be easier implemented internally.

from react-spectrum.

LFDanLu avatar LFDanLu commented on September 24, 2024

Yeah, I think supporting that kind of parent selection behavior makes sense, there is work slated for having the parent be in a "indeterminate" state if a subset of its children are selected already so something like that seems like a natural progression. Would probably become an option on the Tree itself. Would you like to modify this issue to reflect this parent selection instead? Would be good to have this publicly tracked as well

from react-spectrum.

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.