Page MenuHomePhabricator

Tree input control to only allow selection of certain nodes
Open, LowPublicFeature

Description

Hi all,

I pray that you are well.

I have been using Semantic Forms/PageForms for a while now, and it is useful. I have just started trying to use the tree input to simplify some of our more complicated comboboxes.

One thing that I have discovered is that there is no way at the moment to specify which nodes in the tree are selectable - they are always all selectable. I have a use case where I would like to force people to select the lowest-level category in the tree (ie, the leaf nodes) only, but to keep the other parts of the tree visible as it aids in navigating the available options. A couple of ways of implementing this could be:

  • add an option to the tree control field like "select", with options such as "all", "non-root" or "leaf". In the first it would display a selector (radio button or checkbox, as appropriate) on all items, in the second on all nodes except the root(s), and in the third only on the leaf nodes.
  • expand the structure markup syntax slightly, so that you can suppress the appearance of the selector on each item individually as you see fit.

The second option is more flexible but might require more work to set it up.

No major rush for this feature (I can work around it) but I thought it would be nice to have.

Event Timeline

Kriegfrj2 updated the task description. (Show Details)
Yaron_Koren changed the subtype of this task from "Task" to "Feature Request".Apr 25 2023, 8:29 PM