Skip to content
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

Validating input group #765

Open
LocalHeroPro opened this issue Oct 23, 2021 · 5 comments
Open

Validating input group #765

LocalHeroPro opened this issue Oct 23, 2021 · 5 comments
Labels

Comments

@LocalHeroPro
Copy link

Subject of the issue

When validating input group with Bootstrap 5, span is split to new line.

Your environment

  • version of this package: 4.5.1
  • version of Laravel: 8.67.0

Steps to reproduce

https://getbootstrap.com/docs/5.1/forms/input-group/

  1. make form
<div class="input-group mb-3">
  <input id="user_group-email" type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
  <span class="input-group-text" id="basic-addon2">@example.com</span>
</div>
  1. click validate
  2. we get that
<div id="user_group-email-error" class="invalid-feedback">Some validation message</div>

between input and span against on end .input-group.

Expected behaviour

Validation message have to go on end of .input-group class.
image

Actual behaviour

Validation message go after input, but before span.
Before validation
image
After validation
image

@bytestream
Copy link
Collaborator

bytestream commented Oct 25, 2021

You would need to tweak the errorPlacement in https://github.com/proengsoft/laravel-jsvalidation/blob/master/resources/views/bootstrap5.php#L9. See https://jqueryvalidation.org/validate for docs.

I'm not a fan of the existing views. They only act as a starting point. They cannot account for all the different ways users structure HTML, even when a framework is used. In nearly every eventuality the default view will need to be tweaked.

@mankowitz
Copy link
Contributor

mankowitz commented Oct 3, 2022

In the bootstrap4 view, this was addressed. Would it make sense to copy that part? A quick fix is to set

'view' => 'jsvalidation::bootstrap4',

in config/jsvalidation.php.

@bytestream - If I made a PR to include that code into bootstrap5.php, would you accept it?

@bytestream
Copy link
Collaborator

@mankowitz I'm not sure what fix you're referring to in bootstrap4, but sure :)

@bytestream bytestream reopened this Oct 3, 2022
@stale
Copy link

stale bot commented Oct 29, 2022

This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automatically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for contributing :)

@stale stale bot added the stale label Oct 29, 2022
@stale stale bot closed this as completed Nov 12, 2022
@LocalHeroPro
Copy link
Author

LocalHeroPro commented Nov 12, 2022

I think "issue" still exists:
before:
image
after:
image

@bytestream bytestream reopened this Nov 12, 2022
@bytestream bytestream added bug and removed stale labels Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants