当前位置: 动力学知识库 > 问答 > 编程问答 >

dart polymer - How to supply tooltip for PaperDropdown that behaves nicely

问题描述:

If I wrap the paper-dropdown that comes in the paper_elements example in a core-tooltip, the tip displays on hover as expected.

 <core-tooltip position="bottom" label="Choose country of residence">

<paper-dropdown>

<template repeat="{{countries}}">

<paper-item label="{{name}}"></paper-item>

</template>

</paper-dropdown>

</core-tooltip>

The problem is, after selecting an item, the tooltip is still displayed. Additionally in dartium and on chrome there is a fine blue line outlining the tip and the dropdown even as I hover over other elements.

Please explain what is going on and what is the best way to register with the PaperDropdown and/or CoreTooltip that it no longer has focus? I've tried calling focus() another element in the onClick PaperItem in my own examples and that did not seem to work.

Any suggestions on better approaches that might make tooltip unnecessary would be useful as well. The reason for a tooltip is there is no comparable Floating label as with PaperInput for the dropdown. So once a selection is made there is no description, thus the tooltip.

网友答案:

It seems to have to do with focus. Mybe this improves your situation. If this is not what you want just add a comment:

  core-tooltip:focus {
    visibility: hidden !important;
  }

Sometimes the tooltip seems just not to recognize that the element isn't mouse-overed anymore when not the mouse moved out but instead the mouse-overed element shrank away. I would report this as a bug in the <core-overlay> element.

分享给朋友:
您可能感兴趣的文章:
随机阅读: