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

Minor v5 cleanup #334

Merged
merged 4 commits into from May 21, 2021
Merged

Minor v5 cleanup #334

merged 4 commits into from May 21, 2021

Conversation

m5o
Copy link
Collaborator

@m5o m5o commented May 21, 2021

minor cleanup after the bootstrap v5 update.
I've noticed an issue with the input_group and rounded borders

  • remove static id attributes
  • simplify application.scss
  • fix issues with border-radius on input_groups
  • fix input_group tests

/cc @mhw

@m5o m5o merged commit 1468d46 into master May 21, 2021
@m5o m5o deleted the minor-v5-cleanup branch May 21, 2021 14:00
@mhw
Copy link
Contributor

mhw commented May 21, 2021

Hi; what issue did you find with the input_groups rounded corners? The .has-validation class is recommended now to get rounded corners when a field can have validation feedback. Without it invalid fields get square corners on the right-hand end:

image

There is an issue with the static HTML input_groups form: the input elements have square right-hand ends. That's a reported issue so I thought it better to have the markup be what it should be (in theory) for the moment in the hope the issue will be fixed. It's not an issue for simple_form generated markup though as it never generates a .valid-feedback element.

@m5o
Copy link
Collaborator Author

m5o commented May 21, 2021

On the blank form, you see rounded corners on the prepend .input-group-text when the .has-validation-class is included.

Yes, I've noticed the issues with validation feedback but primarily wanted visual parity with the style on the bootstrap documentation.
Check out the examples, https://getbootstrap.com/docs/5.0/forms/input-group/

Screenshot 2021-05-21 at 16 53 53

@mhw
Copy link
Contributor

mhw commented May 21, 2021

Ah, right - I see what you mean. I'd not noticed that previously.

Looking back at the bootstrap PR I think the intention is that .has-validation is only added when there's a <div class="invalid-feedback"> (or valid-feedback). Do you know if that's something simple_form can do?

@m5o
Copy link
Collaborator Author

m5o commented May 25, 2021

As far as I know, there is no way in SF to add additional CSS classes to the parent wrapper if there is an error on the input field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants