Skip to content

How to implement a dropdown tree? #33495

Answered by lostluna1
lostluna1 asked this question in Q&A
Discussion options

You must be logged in to vote
import * as React from "react";
import {
    Combobox,
    makeStyles,
    Option,
    useId,
    ComboboxProps,
    TreeOpenChangeData,
    TreeOpenChangeEvent,
    TreeItemValue,
} from "@fluentui/react-components";
import { Tree, TreeItem, TreeItemLayout } from "@fluentui/react-components";

const useStyles = makeStyles({
    root: {
        display: "grid",
        gridTemplateRows: "repeat(1fr)",
        justifyItems: "start",
        gap: "2px",
        maxWidth: "400px",
    },
    dropdownContent: {
        maxHeight: "200px",
        overflowY: "auto",
    },
});

interface TreeNode {
    label: string;
    children?: TreeNode[];
}

interface DropdownTreeProps extends Partial<Com…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lostluna1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant