material icon indicating copy to clipboard operation
material copied to clipboard

mdTooltip - Allow forcing visibility

Open yjaaidi opened this issue 11 years ago • 3 comments

Hi,

We have some use cases where we want multiple button tooltips to be displayed unconditionally. We are using md-visible but when the user focuses on one of the buttons for example other tooltips disappear due to this listener:

parent.on('blur mouseleave touchend touchcancel', function() {
  // Don't hide the tooltip if the parent is still focused.
  if ($document[0].activeElement === parent[0]) return;
  setVisible(false);
});

Wouldn't it be nice to a have some 'md-visible-force="true"' attribute to disable these listeners in order to fully control the tooltip's visibility using 'md-visible'?

yjaaidi avatar Feb 08 '15 10:02 yjaaidi

I'm pretty sure you should only use one tooltip per element. Are you saying the content of the tooltip changes conditionally?

marcysutton avatar Feb 09 '15 19:02 marcysutton

The text doesn't change and we are only using one tooltip per element.

But we are implementing a fixed floating button that triggers a vertical floating menu. On desktop, showing one tooltip at a time is fine as the tooltip will be displayed on focus. But on touch screens, the user will touch the menu button that will display other buttons and then we want to show all the tooltips for all the buttons simultaneously, otherwise the user has no way to understand the use of the button.

By using, md-visible="true", it works but when the user touches one of the buttons, this triggers a focus event on the touched button and a blur event on other buttons which hides the tooltip of other buttons so the next time when the user triggers the menu again, the tooltip will only be displayed on the last clicked button. float_menu_button float_menu_focus

yjaaidi avatar Feb 10 '15 09:02 yjaaidi

I am on the same boat. I would like to show tooltips using md-visible but the way that focus events are handled is a bit confusing (to my relatively non-javascript savvy eyes).

I am talking about this: ($document[0].activeElement !== parent[0])

I am trying to implement a speed dial fab menu and I am showing the tooltip 0.3s after the trigger button is hovered. But when I hover over each of the buttons, the above code is true and the tooltips get hidden for a millisecond.

Hope this is related to the issue mentioned here.

evoker avatar Dec 03 '15 11:12 evoker