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

Make error_class work on inner wrapper #1729

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lafeber
Copy link

@lafeber lafeber commented Mar 3, 2021

Fix for #1727

@lafeber
Copy link
Author

lafeber commented Mar 12, 2021

@carlosantoniodasilva If you have some time to look at this, it would be greatly appreciated!

@lafeber
Copy link
Author

lafeber commented Mar 17, 2021

@rafaelfranca If you have some time to look at this, it would be greatly appreciated!

@carlosantoniodasilva
Copy link
Member

@lafeber I did get your initial ping and should've commented back that'd get to it here, that was my bad, but please be a little patient. :) Thanks!

@lafeber
Copy link
Author

lafeber commented Mar 24, 2021

@carlosantoniodasilva I'm truly sorry, I didn't mean to be impatient. I appreciate all the work you put in this gem - it's one of my all time favourites.

@jeremybdk
Copy link

Hello everyone, I was wondering if you plan to merge this as we're also facing this issue.

Thanks

@HectorMF
Copy link

This change solves some issues I was having as well, would be great if it was merged in!

@@ -67,7 +67,9 @@ def html_options(options)
end

def html_classes(input, options)
@defaults[:class].dup
css = @defaults[:class].dup
css << @defaults[:error_class].dup { input.has_errors? }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
css << @defaults[:error_class].dup { input.has_errors? }
css << @defaults[:error_class] if input.has_errors?

Aslo if there's no error class setup on wrapper then there's
no need to check for errors.
@nashby
Copy link
Collaborator

nashby commented Oct 2, 2022

@rafaelfranca @lafeber I updated this PR with a fix to how we check for input's errors. Previously it wasn't properly checking it so my newly added spec was failing. I fixed that. @rafaelfranca @carlosantoniodasilva if PR looks good to you I'll merge it and will update Changelog/README afterward.

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.

7 participants