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

Figure it out a good way to remove title= attribute on intersphinx nodes #133

Closed
humitos opened this issue Jun 1, 2021 · 3 comments · Fixed by #150
Closed

Figure it out a good way to remove title= attribute on intersphinx nodes #133

humitos opened this issue Jun 1, 2021 · 3 comments · Fixed by #150
Labels
Improvement Minor improvement to code

Comments

@humitos
Copy link
Member

humitos commented Jun 1, 2021

I originally removed the node['reftitle'] attribute because it doesn't make sense the browser shows the default tooltip (browser's built-in) and immediately after that our tooltip was shown. This behavior is a little confusing and it's not styled in my opinion. That's why I removed it.

Screenshot_2021-06-01_16-34-21

However, removing this attribute made other extensions break (sphinx.ext.inheritance_diagram) which expects that attribute exists.

I went back in 0a75b73 (#86) and I'm opening this issue to find a better solution to avoid this.

We could:

  1. define it as node['reftitle'] = ''
    • it makes the browser to not show the built-in tooltip
    • I'm not sure about the accessibility implication it has
    • is the HTML still valid? It will generate a <a title=""> tag
  2. use javascript to remove all the title= from tags with .hoverxref .external on document load
  3. other ideas?

See #86 (comment)

@humitos humitos added Improvement Minor improvement to code Needed: design decision A core team decision is required labels Jun 1, 2021
@stsewd
Copy link
Member

stsewd commented Jun 1, 2021

use javascript to remove all the title= from tags with .hoverxref .external on document load

I think that's a good solution, and it also keeps a good experience for people that don't have js enabled.

@stsewd
Copy link
Member

stsewd commented Jun 1, 2021

Also, maybe there is a way to disable/improve the default tooltip with css?

@humitos
Copy link
Member Author

humitos commented Sep 27, 2021

use javascript to remove all the title= from tags with .hoverxref .external on document load

I found that this code works find only over our own nodes:

$('.hoverxref').each(function () { $(this).removeAttr('title')});

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

Successfully merging a pull request may close this issue.

2 participants