Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In the form control wrapper wrap the elements inside a <div> #209

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

Closed
gfoidl wants to merge 2 commits into coreui:main from gfoidl:form-controller-wrapper-div

Conversation

Copy link
Contributor

@gfoidl gfoidl commented May 6, 2022

Without wrapping inside a <div> the valiation feedback may be shown on other input-controls too, which is not intended.
Thus we need to wrap all controls related to the input inside a div, in order to scope the style to it.

Copy link

github-actions bot commented Aug 8, 2022

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Copy link
Contributor Author

gfoidl commented Aug 8, 2022

Please don't close, mege instead 😉

Copy link

github-actions bot commented Oct 8, 2022

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Copy link
Contributor Author

gfoidl commented Oct 8, 2022

Please don't close, mege instead 😉

Still the same.

Copy link
Member

mrholek commented Oct 18, 2022

@gfoidl Without wrapping inside a div the valiation feedback may be shown on other input-controls too, which is not intended. Can you show me an example?

Copy link
Contributor Author

gfoidl commented Oct 18, 2022
edited
Loading

From https://playcode.io/988904

grafik

The seconds input has no invalid set, also the red border isn't shown. But the feedbackInvalid is shown, which is wrong.
This PR corrects that behavior.

It has to do on how bootstrap validation rules are specified in CSS.

Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Copy link
Contributor Author

gfoidl commented Dec 20, 2022

Dear bot, don't close and disable yourself.

Copy link
Member

mrholek commented Jan 17, 2023

@gfoidl I just checked it and an additional div breaks <CInputGroup /> layout.

Copy link
Contributor Author

gfoidl commented Jan 17, 2023

Then this should be fixed (too).
In #209 (comment) when the <div>s are removed it's wrong behavior.

For my use I fixed this locally, and there's also a <CInputGroup /> -- the layout is correct and not broken.
Bootstrap didn't change in how the validation rules are specified, so a wrapper div for the inputs is needed.

Copy link
Member

mrholek commented Jan 17, 2023

@gfoidl please check this css

.input-group > .form-control,
.input-group > .form-select,
.input-group > .form-floating {
 position: relative;
 flex: 1 1 auto;
 width: 1%;
 min-width: 0;
}
.input-group > .form-control:focus,
.input-group > .form-select:focus,
.input-group > .form-floating:focus-within {
 z-index: 5;
}

if we add an additional div, then we will have something like that .input-group > div instead of .input-group >.form-control

Copy link
Contributor Author

gfoidl commented Jan 17, 2023

Yep, that's right.

But

<script setup>
 import { ref, computed } from 'vue'

 const name = ref("");
 const age = ref();
</script>
<template>
 <CForm novalidate>
 <CFormInput label="Name" :value="name" feedbackInvalid="Name must be entered" invalid />
 <!-- Note no 'invalid' given here-->
 <CFormInput label="Age" :value="age" type="number" feedbackInvalid="Age must be given" />
 </CForm>
</template>
<style>
 form {
 width: 60%;
 margin: 1rem;
 }
</style>

Will show the feedbackInvalid on the second input where it should not be shown.
How would solve that issue otherwise?

Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

gfoidl reacted with thumbs down emoji gfoidl reacted with confused emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /