You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case the input is nested within an .input-group and the class cannot be found on this one, but is located a bit higher above.
The detection mechanism should rather search for the class on any parent and then check, if such a node can be found. Something like @element.has_xpath?("ancestor-or-self::*[contains(@class, \"#field_with_errors\")]") (compare to custom_error?.
For now, I can use the custom_error? by setting Spreewald.field_error_class = 'field_with_errors' to help because it does exactly that. However, I feel that this should also be the default behavior for the rails_error? method.
The text was updated successfully, but these errors were encountered:
The rails error detection mechanism works only, if an input is placed as direct child under a container with the
field_with_errors
class, e.g. a.form-group
. That is because it does only check for this class on the direct parent node. See https://github.com/makandra/spreewald/blob/master/lib/spreewald_support/field_errors.rb#L52In my case the input is nested within an
.input-group
and the class cannot be found on this one, but is located a bit higher above.The detection mechanism should rather search for the class on any parent and then check, if such a node can be found. Something like
@element.has_xpath?("ancestor-or-self::*[contains(@class, \"#field_with_errors\")]")
(compare tocustom_error?
.For now, I can use the
custom_error?
by settingSpreewald.field_error_class = 'field_with_errors'
to help because it does exactly that. However, I feel that this should also be the default behavior for therails_error?
method.The text was updated successfully, but these errors were encountered: