Giter Site home page Giter Site logo

core-tooltip's Introduction

core-tooltip's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core-tooltip's Issues

max-width and multiline

When the content of the tooltip is too long compared to the screen width, part of the text is hidden.
Is it possible to add a max-width to avoid this ? (using multiple lines for example)

Cannot force tooltip to hide

I would like to force the tooltip to hide, reverse of what the "show" property does.

My scenario is that I have a paper-dropdown that opens up over a tooltip. The dropdown does not cover the tooltip so it shows through the dropdown. So I want some way of hiding the tooltip until the dropdown closes.

Handle dynamic updates to position

Currently, if the position attribute changes from bottom/top -> left/right the CSS left/right properties stick around. This makes the tooltip now appear in the correct location.

The fix is to reset these values to their initial state when a switch is made.

tipAttribute is not working properly

From @saan1984 on January 26, 2015 14:39

tipAttribute is not working when it takes value other then htmlooltip.
For example,

<core-tooltip tipAttribute="abcd">
  <div>Example of a rich information tooltip</div>
  <div abcd>
       ...
  </div>
</core-tooltip>

Copied from original issue: Polymer/polymer#1126

Sizing does not work on IE11

Die width of #tooltip is just some 10px on the IE and hence the inner tooltip elements are wider than the background element. A fix for this is

tooltip {

width: 100%;
}

so even IE understands to make the #tooltip as wide as the <div tip>.

Wrong left attribute calculation of tooltip

I've implemented a toolbar with several core-icon-button and tooltips. The code is as follow:

<core-tooltip label="{{i18n.formatclear}}" position="bottom">
        <core-icon-button id="clear" icon="editor:format-clear" on-tap="{{formatText}}"></core-icon-button>
</core-tooltip>

The problem here is that the tooltip is not centered below the core-icon-button but left aligned! See screenshot:
screen shot 2015-04-24 at 14 06 24

In the debugger the element.style left attribute is 0px. See:
screen shot 2015-04-24 at 13 51 23

Any suggestions why the calculation of left here is 0px instead of some negative value???

aria attributes may be incorrect

Currently the core-tooltip attribute gets the role="tooltip" attribute applied to it, but I believe this is incorrect. Shouldn't it be the div#tooltip element that needs role="tooltip" and the core-tooltipe element should have aria-describedby="tooltip"?

I understand that that relying on the tooltip id of the div#tooltip element in the shadow dom may not work in any user agents, because most accessibility user agents don't consider non-unique IDs (a la shadow dom). This was just an issue I wanted brought up.

Tooltip stays visible when content button/element is released [mobile]

Using 0.5.2 on a Nexus 9 stable channel Chrome.

I have a <core-tooltip> that hosts <core-item> and <paper-icon-button> both have the same problem.

I like that on touch/press and hold it shows the tooltip, I think this is good behavior. The user can still move his finger out if he wishes to not act on the element. But when the touch/tap is released on the element the tooltip wont hide.

On desktop the tooltip hides once you move your mouse from the element but on mobile you need to click/tap/touch somewhere else on the screen to hide the tooltip. Actually just moving your finger does not hide it, you need to tap a screen location (I guess removing the focus from the tooltip content). Very annoying for the user experience.

Any possibility this mobile release event could be detected form the <core-focusable> the tooltip extends? Is this a bug in there? Seems the button/item release event comes fine as the tap on it is recognized.

I know I could do some JS hack where I detect click/tap events and go through all my elements tooltips and hide them, but this is quite some work for something that I would expect to just work.

Thanks :)

disabled attribute causes nested elements to be disabled

Let's say I want to show the tooltip only when the password is incorrect. invalidLogin is false by default, so the core-tooltip is disabled but then the paper-inputelement is also disabled!

<core-tooltip  flex label="Password is incorrect" position="right" disabled?="{{!invalidLogin}}" show>
  <paper-input-decorator label="Password" floatingLabel="true">
    <input id="password" is="core-input" type="password" value="{{password}}" />
  </paper-input-decorator>
</core-tooltip>

Setting width of tooltip window?

For longer description text it's necessary to set the width of the tooltip window to limit the width of the window. Otherwise the tooltip will stretch itself over the whole screen which does not increase the readability.

Thanks.

Sizing is done at "attach" time

The core-tooltip centers itself as soon as it's attached to the DOM. That's too early
for certain cases; in AngularJS for example, it binds data to the DOM after the DOM is attached. As a result, the tooltip's size (really, its location) is not computed at the right time. A workaround was to call setPosition after Angular populated the DOM.

Tooltip hides when child element gains focus

Because of the tabindex attribute of core-tooltip, activating a control using keyboard requires an extra TAB key press. Pressing ENTER to activate the control when tooltip is visible does nothing as the focus is with tooltip. Pressing another TAB at this point, hides the tooltip and takes the focus to actual control. So, pressing ENTER activates the control now.

Removing the tabindex attribute from core-tooltip and adding listeners for focus and blur events in capture mode, to show/hide the tooltip solves this focus issue. With this, there is also a need to override disabledChanged method of core-focusable so that it doesn't add tabindex attribute to it.

The handlers for the events would look like this:

  onBlur: function(e) {
    this.classList.remove('core-tooltip-focused');
  },

  onFocus: function(e) {
    if (!this.pressed) {
      this.classList.add('core-tooltip-focused');
    }
  }

Css class core-tooltip-focused can then set the visibility of the tooltip.

Consider "title" instead of "label"

Tooltips are improvements on the native functionality of the "title" attribute, i.e. show a message on a long enough hover (on a platform with a pointer). Using native/standard "title" instead of the custom "label" gives fallback functionality and keeps the API familiar to someone who knows HTML.

Adding a tooltip to an element whose parent has overflow:hidden can obscure portions of the tooltip when displayed

If an element with a tooltip is contained within an element whose overflow is hidden the tooltip may not be visible, or may be only partially visible. It will be clipped to the bounds of the parent.

An example codepen is at : http://codepen.io/awk/pen/RNgbEN

Removing the overflow:hidden style attribute isn't practical for our current layout (unfortunately).

Bootstrap tooltips have an option (which we use) to add the tooltip to the <body> however this feels excessive and would lead to lots of shadow-dome on the body element in our case since we have a toolbar which dozens of icons and associated tooltips.

(See also: https://groups.google.com/d/msgid/polymer-dev/0cbc3453-d47a-41cd-b1d0-dd0cae61a346%40googlegroups.com)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.