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

Issues with Tooltip docs #11054

Closed
glen-84 opened this issue Mar 14, 2018 · 8 comments
Closed

Issues with Tooltip docs #11054

glen-84 opened this issue Mar 14, 2018 · 8 comments

Comments

@glen-84
Copy link
Contributor

glen-84 commented Mar 14, 2018

From the example provided:

<span
    data-tooltip
    aria-haspopup="true"
    class="has-tip"
    data-disable-hover="false"
    tabindex="1"
    title="Fancy word for a beetle.">

aria-haspopup="true"

According to this doc, this attribute is not applicable to tooltips:

A tooltip is not considered to be a popup in this context.

class="has-tip"

This class is added automatically, so it seems unnecessary unless you want to ensure that the CSS is applied even if the JS fails to execute (but then the tooltip, at least the Foundation one, would not show anyway).

data-disable-hover="false"

This is the default value, so it's unnecessary to include it.

tabindex="1"

It would be good to document this. I don't really understand its purpose.

@ncoden ncoden self-assigned this Mar 15, 2018
ncoden added a commit to ncoden/foundation-sites that referenced this issue Mar 15, 2018
* `[aria-haspopup]` is not recommanded for tooltips
* `.has-tip` class is automatically added
* `[data-click-open=false]` is not needed as `clickOpen` has for default value `false`

See foundation#11054
@ncoden ncoden added the PR open label Mar 15, 2018
@ncoden
Copy link
Contributor

ncoden commented Mar 15, 2018

Hi @glen-84. Thanks for the issue. I opened 2 PRs: #11056 and #11057.

ncoden added a commit that referenced this issue Mar 19, 2018
@glen-84
Copy link
Contributor Author

glen-84 commented Mar 27, 2018

Does anyone know why the tabindex is added?

@DanielRuf
Copy link
Contributor

DanielRuf commented Mar 27, 2018

tabindex is for a11y and tabbing support.

@glen-84
Copy link
Contributor Author

glen-84 commented Mar 27, 2018

I know – I'm asking specifically about what it does in this case. 🙂

@DanielRuf
Copy link
Contributor

It makes it accessible for screenreaders and people with assistive solutions.

@glen-84
Copy link
Contributor Author

glen-84 commented Mar 27, 2018

I've found the answer. Without the tabindex, the element is not "focusable". With the attribute, the element can receive focus, and the tooltip is displayed.

@DanielRuf
Copy link
Contributor

Right, that's what I've meant with "assistive solutions" like the OSD (onscreen keyboard) and other things like keyboard users (specific person groups).

@ncoden
Copy link
Contributor

ncoden commented Mar 27, 2018

I guess this can be closed.

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

No branches or pull requests

3 participants