Preventing the contents of draggable polymer elements from being selectable

一曲冷凌霜 提交于 2019-12-11 08:16:57

问题


I have a polymer element defined as follows

<polymer-element name="draggable-list-item" >
  <template>

    <core-style ref="draggable-list-item"></core-style>

    <div id="row-container" draggable="true">
      <content></content>
    </div>

  </template>
  <script type="application/dart" src="draggable_list_item.dart"></script>
</polymer-element>

I know that for normal elements (non polymer / web component) that I need to add a style like

  [draggable] {
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    user-select: none;
  }

And everything is awesome

I can't get this to work with polymer. I can drag the item if I select it outside of the contents of the child polymer element. But not over it. I've tried various variants of

  [draggable]  /deep/ * {
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    user-select: none;
  }

but nothing seems to work

来源:https://stackoverflow.com/questions/26271903/preventing-the-contents-of-draggable-polymer-elements-from-being-selectable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!