Using b-form-invalid-feedback together with a b-input-group
See original GitHub issueThis might be related to #1566. I have a text input field with a button appended to its right side. I want to show some feedback, when the user enters wrong data. However, with the current setup, this breaks my layout as soon as the text appears, because it throws the button below the error text.
<b-input-group prepend="Serial or part №" class="mb-3">
<b-form-input type="text" class="form-control" v-model="dataEntryNumber" placeholder="Please enter a serial or part number here" :state="dataEntryNumberInvalid ? false : null"></b-form-input>
<b-form-invalid-feedback>
This is not a valid product.
</b-form-invalid-feedback>
<b-input-group-append>
<b-button variant="success" @click="getOrder()" :disabled="!dataEntryNumber || gettingOrder || complaint.articles.length >= 10">
<font-awesome-icon v-if="gettingOrder" icon="spinner" pulse />
<font-awesome-icon v-else icon="plus" />
</b-button>
</b-input-group-append>
</b-input-group>
Placing the invalid feedback part below the input group (which would sound logic to me), doesn’t work as well, because it must be a direct sibling of the input. So how can I fix this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Form Group | Components - BootstrapVue
Easily add some structure to forms. Its purpose is to pair form controls with a legend or label, and to provide help text...
Read more >Bootstrap 4 invalid feedback with input group not displaying
I'm using Bootstrap 4.3 and following code worked for me. Try adding "validated" class with "form ...
Read more >Form Validation | Reference | BootstrapVue
This example shows how to add different validation and feedback to two form fields, as well as dynamically disable the submit button based...
Read more >Forms - Bootstrap
Checkboxes and radios use are built to support HTML-based form validation and provide concise, accessible labels. As such, our <input> s and <label>...
Read more >Vue Validation - examples & tutorial
Provide valuable, actionable feedback to your users with Vue form validation, ... Note: We currently recommend using custom validation styles, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a bootstrap V4.x issue (and has many, many open and closed issues at their GitHub repo).
If you are using javascript validation, I would suggest placing the feedback under the input group and setting the ‘state’ prop on both the input and feedback components.
If you are relying only on browser validation, then you are S.O.L. with Bootstrap V4.x CSS 😦
Most are closed: but are not resolved:
and more…
it is because of the sibling selector combo needed for native input validation. With “javascript” validation (or server-side validation as bootstrap calls it) we have more control since we can use the
state
prop of inputs and feedback to force show the validation state and feedback, regardless of placement.