-
Notifications
You must be signed in to change notification settings - Fork 205
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
Bootstrap 4 Framework uses wrong classes for input group & no classes for checkbox #581
Comments
Thanks so much! Any chance you'd be willing to submit a PR? |
Unfortunately, I currently do not have the time to submit a PR. Line used: Former::checkbox('test')->text('Test'); Rendered with invalid feedback: <div class="form-group is-invalid">
<div class="form-check">
<input id="test" type="checkbox" name="test" value="1">
<label for="test" class="">Test</label>
</div>
<div class="invalid-feedback">Error message.</div>
</div> Expected with invalid feedback: <div class="form-group is-invalid">
<div class="form-check">
<input class="form-check-input" id="test" type="checkbox" name="test" value="1">
<label for="test" class="form-check-label">Test</label>
<div class="invalid-feedback">Error message.</div>
</div>
</div> Solution: place .valid-/.invalid-feedback inside .form-check to actually display the feedback message. |
I ran into the same issue. Hacked the code, it works nicely so i can continue developing our app while this gets fixed the proper way, and released. in Former/Form/Group.php, find in Former/Framework/TwitterBootstrap4.php, find edit: actually, it should be |
Thanks, @mrextreme ! Now we just need someone to package up the above into a PR with tests -- any takers? |
edited my comment above to be backwards-compatible |
Can I please ask that you merge my PR to fix the issue with the wrong class for checkboxes and radios? Fine if the code is altered. Just need the checkbox styling to work properly for Bootstrap 4. |
@CedNet Done. |
Has there been any movement on getting a PR together for fixing this? |
Usage with Laravel: {{-- Basic input addon --}} {!! Former::open()->method('GET') !!} {!! Former::text('test2')->append('€') !!} {!! Former::close() !!} {{-- Multiple input addons --}} {!! Former::open()->method('GET') !!} {!! Former::text('test3')->append(['€', 'second']) !!} {!! Former::close() !!} {{-- Button addon --}} {!! Former::open()->method('GET') !!} {!! Former::text('test4')->append('<button class="btn">OK</button>') !!} {!! Former::close() !!} {{-- Button addons --}} {!! Former::open()->method('GET') !!} {!! Former::text('test5')->append(['<button class="btn">OK</button>', '<button class="btn">2</button>']) !!} {!! Former::close() !!} Credits: @mrextreme Reference: formers#581 (comment)
E.g. {!! Former::open()->method('GET') !!} {!! Former::checkbox('test')->text('Test checkbox') !!} {!! Former::close() !!} Render: <div class="form-check"> <input class="form-check-input" id="test" type="checkbox" name="test" value="1"> <label for="test" class="form-check-label">Test checkbox</label> </div> References: - formers#581 - formers#590
E.g. with Laravel: @php $validator = Validator::make(request()->all(), [ 'failed_checkbox' => 'required', 'failed_radio' => 'required', 'failed_inline_checkbox' => 'required', 'failed_inline_radio' => 'required', 'failed_checkboxes' => 'required', 'failed_inline_checkboxes' => 'required', ]); $validator->fails(); Former::withErrors($validator); @endphp {!! Former::open()->method('GET') !!} {!! Former::checkbox('failed_checkbox')->text('Failed checkbox') !!} {!! Former::radio('failed_radio')->text('Failed radio') !!} {!! Former::checkbox('failed_inline_checkbox')->text('Failed inline checkbox')->inline() !!} {!! Former::radio('failed_inline_radio')->text('Failed inline radio')->inline() !!} {!! Former::checkboxes('failed_checkboxes')->checkboxes('first', 'second', 'third', 'fourth') !!} {!! Former::checkboxes('failed_inline_checkboxes')->checkboxes('first', 'second', 'third', 'fourth')->inline() !!} {!! Former::close() !!} Reference: formers#581 (comment)
There were currently two bugs with the Bootstrap 4 framework. Tested in Bootstrap v4.1.3 and v4.3.1 (latest) and used in Laravel 5.7.*
Input Group with Append
Problem: appended/prepended text is not displaying correctly because of wrong class "input-group-addon".
Line used:
Renders:
Expected:
Checkbox
Problem: small displaying tweaks because of missing classes for input and label.
Line used:
Renders:
Expected:
The text was updated successfully, but these errors were encountered: