bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.3k stars 183 forks source link

FormGroup classes applied to wrong element #530

Open jer-0 opened 1 year ago

jer-0 commented 1 year ago

classes in FormGroup component is being applied to wrong element causing it to have no effect.

code:

<FormGroup inline={true} check={true}>
    <Input
        id="r1"
        type="radio"
        bind:group={mode}
        value="create"
        label="Create"
    />
    <Input
        id="r2"
        type="radio"
        bind:group={mode}
        value="update"
        label="Update"
    />
</FormGroup>

dom: Screenshot 2023-01-30 152322

as you can see, .form-check-inline class should be on child .form-check div

bootstrap docs ref: https://getbootstrap.com/docs/5.3/forms/checks-radios/#inline

workaround:

<FormCheck inline={true} type={'radio'} name={"mode"} label={'Create'} value={'create'} />
<FormCheck inline={true} type={'radio'} name={"mode"} label={'Update'} value={'update'} />

Thanks