纸张下拉菜单:聚合物 2.0 出错



嗨,堆栈溢出用户,

我想将纸质下拉菜单与聚合物 2.0 一起使用,但是当我单击该元素时,出现以下错误:

Uncaught TypeError: Cannot assign to read only property 'target' of object '#<AnimationPlaybackEvent>'
at b.Animation.<anonymous> (web-animations-next-animation.js:223)

我已经安装了纸质下拉菜单#2.0预览版。

我尝试了文档中非常简单的示例代码:

<paper-dropdown-menu label="Dinosaurs">
<paper-listbox class="dropdown-content" selected="1">
<paper-item>allosaurus</paper-item>
<paper-item>brontosaurus</paper-item>
<paper-item>carcharodontosaurus</paper-item>
<paper-item>diplodocus</paper-item>
</paper-listbox>
</paper-dropdown-menu>

你能帮我吗?

谢谢。

菲尔

这似乎是与web-animations-js库的兼容性问题。他们在 2017 年 4 月 13 日发布了一个版本,该版本也开始在 1.x 版本的 paper-drowpdown-menu 中引起此问题。在此日期之后进行 bower 更新的任何人都可能会看到相同的行为,直到它得到解决。

将其添加到您的 bower.json 文件中应该会为您修复该行为:

"web-animations-js": "web-animations/web-animations-js#2.2.2">

我已经提交了关于此中断依赖项的带有纸质下拉菜单的问题:https://github.com/PolymerElements/paper-dropdown-menu/issues/241

最新更新