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

Radio group error message placement #19

Open
cferdinandi opened this issue Dec 3, 2018 · 6 comments
Open

Radio group error message placement #19

cferdinandi opened this issue Dec 3, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@cferdinandi
Copy link
Owner

For radio groups with messageAfterField set to false, grab first item in group instead of last for error field.

Potentially also use field instead of label.

@cferdinandi cferdinandi added the bug Something isn't working label Dec 3, 2018
@robsonsobral
Copy link
Contributor

robsonsobral commented Dec 11, 2018

Wow! I was thinking of that!

  <ul>
    <li>
      <input type="checkbox" id="use-terms" required aria-required="true" disabled>
      <label for="use-terms">
        {{ i18n "iReadAndAccepted" }}
        <a href="/termos-de-uso" target="_blank">
          {{ i18n "useTerms" }}
        </a>
      </label>
    </li>
  </ul>

The data-bouncer-target can be really useful in that case, but I think they should have a hidden attribute by default. From MDN:

The hidden global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. Browsers won't render elements with the hidden attribute set.

@robsonsobral
Copy link
Contributor

(I'm not sure this is the right place for my message. I'm sorry. I'm under medication and a little off.)

@cferdinandi
Copy link
Owner Author

I'm not sure I understand what you're saying. Do you mean the target location for the error should be hidden? Ideally it's just an empty div since the message is dynamically rendered.

1 similar comment
@cferdinandi
Copy link
Owner Author

I'm not sure I understand what you're saying. Do you mean the target location for the error should be hidden? Ideally it's just an empty div since the message is dynamically rendered.

@robsonsobral
Copy link
Contributor

I'm sorry, @cferdinandi . I should have opened a new issue. Yes, an empty element should be hidden until became relevant. The plugin need to check if the hidden attribute is present and remove it.

I'm sorry for the mess.

@cferdinandi
Copy link
Owner Author

Oh... I disagree with you on this one. There's no benefit to hiding an empty element. There's no content in it. Screen readers won't announce anything for it, and without content, sighted users won't see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants