folkehelseinstituttet / Fhi.Frontend.Demo

MIT License
2 stars 1 forks source link

FhiTreeViewSelectionComponent: Unselected children of selected parents are expanded when the "expandCheckedItems" is set in updateDecendantState #578

Closed bittakv closed 1 month ago

bittakv commented 1 month ago

Noden "Komponenter" er sjekket av, og barna til "Komponenter" er ekspandert: image

Det skal se slik ut, ("Komponenter" skal ikke være ekspandert): image

Items input:

Input items:
[
      {
        name: 'For utviklere',
        children: [
          {
            name: 'Visuell identitet',
          },
          {
            name: 'Komponenter',
            isChecked: true,  // <--------------- Checked parent-node node
            children: [
              {
                name: 'Accordions',
              },
              {
                name: 'Advanced select',
              },
              {
                name: 'Alerts',
              },
            ],
          },
          {
            name: 'Layout og sidemaler',
          },
        ],
      },
      {
        name: 'For designere',
        id: 'for-designere',
      },
      {
        name: 'Github',
        children: [
          {
            name: 'Fhi.Frontend.Style',
          },
        ],
      },
    ];
dafn commented 1 month ago

I accidentally posted this on the PR, but it belongs here:

Could you give me steps to reproduce the bug?

bittakv commented 1 month ago

The items passed to the component must have one or more items that has children, and the item must be checked. (As the item with name "Komponenter" in the input listed in the description.