vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.95k stars 239 forks source link

Bootstrap4 radio inline option has no effect #397

Closed ChristopherLivett closed 6 years ago

ChristopherLivett commented 6 years ago

When creating a component with and a set of allowedValues in the schema, it is being displayed horizontally rather than vertically.

This can be reproduced on https://uniforms.tools/ by changing the rating schema to

    rating: {
        type: Number,
        allowedValues: [1, 2, 3, 4, 5],
        uniforms: {
            checkboxes: true,
            inline: true,
        }
    },

Switching to bootstrap3 shows radio buttons inline, but bootstrap4 does not.

radekmie commented 6 years ago

@janslowik: you've updated this theme lastly. Maybe you'd like to give it a shot?

radekmie commented 6 years ago

It turned out to be a problem with the demo - it was using an outdated package. Sorry for the inconvenience, @ChristopherLivett!

danilomiranda commented 6 years ago

Hey @radekmie I'm facing the same problem in my application. packages: "uniforms": "^1.23.2", "uniforms-bootstrap4": "^1.23.2" FORM

<AutoForm
      schema={schema}
      model={model}
      onChangeModel={onChange}
    >
        <RadioField name="CA1A" />

    </AutoForm>);

SCHEMA

  CA1A: {
    type: String,
    optional: true,
    uniforms: {
      checkboxes: true,
      label: 'Radio',
      options: [{
        label: 'Some Option',
        value: 'Some Option',
      }, {
        label: 'Other',
        value: 'Other',
      }],
    },
  },
radekmie commented 6 years ago

Hi @danilomiranda. You don’t have an inline option set.

danilomiranda commented 6 years ago

I put inline option, no effect try this

<RadioField name="CA1A" inline={false} />

and this

 CA1A: {
    type: String,
    optional: true,
    uniforms: {
      checkboxes: true,
      label: 'Radio',
      inline: true,
      options: [{
        label: 'Some Option',
        value: 'Some Option',
      }, {
        label: 'Other',
        value: 'Other',
      }],
    },
  },

Same problem

radekmie commented 6 years ago

Wait, so you want to make it inline or not? Your example is not consistent.

danilomiranda commented 6 years ago

Ouch, my bad. i posted on the wrong issue My problem is that the check are not marking when we click on it

danilomiranda commented 6 years ago

@radekmie Should I post my issue here? https://github.com/vazco/uniforms/issues/396

radekmie commented 6 years ago

If it’s related. If not, file another or simply ask on Gitter.