Code Monkey home page Code Monkey logo

Comments (3)

heath-freenome avatar heath-freenome commented on May 23, 2024

@memchenko I've created an example using your schema with a UiSchema that sets the title. I believe that you can do the same for yours only use widget instead. So something like:

{
   a: {
     "ui:widget": "buttonGroup"
   },
  b: {
     "ui:widget": "phone",
  }
}

from react-jsonschema-form.

memchenko avatar memchenko commented on May 23, 2024

@heath-freenome Hi, thank you for your response! The example you created contains a couple of problems I try to solve. First problem is that widget for a property doesn't get all the possible options. Here you can see the the select has not any option:
Screen Shot 2024-04-08 at 12 55 46 PM

And the second problem is that there appears the dropdown on the top with options "Option 1" and "Option 2" which allows to switch between schemas. However, I'd like it to work the way dependencies definition works. Meaning when user selects an option in the dropdown for the a property a corresponding subschema applies. This is what I get with this approach so far though:
Screen Shot 2024-04-08 at 12 55 57 PM

For illustration I tweaked your example, you can check it here

from react-jsonschema-form.

nickgros avatar nickgros commented on May 23, 2024

@memchenko I think the issue here is that we don't have great support for the const keyword (see #1241)

If you replace the const with oneOf/const(or enum) it should be closer to what you expect. Here's a playground link.

from react-jsonschema-form.

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.