Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced input types #83

Open
kalgon opened this issue Jul 30, 2021 · 1 comment
Open

Enhanced input types #83

kalgon opened this issue Jul 30, 2021 · 1 comment

Comments

@kalgon
Copy link

kalgon commented Jul 30, 2021

I have a usecase where a user has to choose a node in a tree structure.

I could represent that choice as a select/radio input but it could grow too big and it would be nicer if the real tree structure was shown in the form (instead of an flattened structure).

I would prefer to keep select/radio as input type over a new/custom one (tree) because select/radio are standard and degrade gracefully if the client would not know about the new (non-standard) type.

Therefore, I need some extra information about how my input could be rendered.

Is there anything in the current spec that would allow me to do that?

I had something like this in mind:

{
  "_templates" : {
    "default" : {
      ...
      "properties" : [
        {
          "name" : "directory",
          "prompt" : "Directory",
          "type" : "select",
          "options" : {
            "inline" : [
              "foo",
              "foo/bar",
              "foo/bar/baz",
              "foo/bar/qux",
              "bar",
              "bar/baz/qux",
              ...
            ]
          },
          "hints" : {
            "tree" : {
              "separator" : "/",
              "collapseAtLevel" : 2
            }
          }
        }
      ]
    }
  }
}
@mamund
Copy link
Owner

mamund commented Aug 24, 2021

there is nothing built into the spec right now to handle this, i think.

however, if you'd like to build up a working extension that would be backward compatible, that'd be a great first step.

one you have a working vesrion to share, we can talk about whether it becomes a listed extension and, if it gets uptake, eventually moves along to become a feature at some future point.

looking forward to seeing your working example.

cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants