Skip to content

Commit

Permalink
doc: update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Dec 6, 2024
1 parent 8ea9c7b commit b865ccb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const generateRequestErrors = (values: Record<string, any>, errors: object[], se
setError(field, {message: Array.isArray(value) ? value[0] : value}, {shouldFocus: canFocus});

if (!canFocus) {
// In custom fields that aren't inputs by default or hidden inputs, we need to use this workaround because the "shouldFocus" option will not work on these cases.
// In fields that aren't inputs by default or are hidden inputs, we need to use this workaround because the "shouldFocus" option will not work in these cases.
if (!fieldElement) {
const fieldElementContainer = document.querySelector('.givewp-fields-' + String(field)); //E.g: <div class="givewp-fields-giftAid">content...</div>
fieldElementContainer.scrollIntoView({behavior: 'smooth'});
Expand Down

0 comments on commit b865ccb

Please sign in to comment.