Events “聚合物纸吐司”;未捕获类型错误:无法读取属性';尺寸';null core overlay.html的;
我在本地开发人员的paper toast元素上遇到了这个问题(但无法在此处复制) 然后我找到了对我有效的解决方案,但不知道为什么有效。只需将该发现放在此处,没有问题: 当放置在“核心更改”或“更改”侦听器中时,出现以下错误:Events “聚合物纸吐司”;未捕获类型错误:无法读取属性';尺寸';null core overlay.html的;,events,polymer,Events,Polymer,我在本地开发人员的paper toast元素上遇到了这个问题(但无法在此处复制) 然后我找到了对我有效的解决方案,但不知道为什么有效。只需将该发现放在此处,没有问题: 当放置在“核心更改”或“更改”侦听器中时,出现以下错误: <script> document.querySelector('.validation').addEventListener('core-change', function(e) { console.log('validation core-cha
<script>
document.querySelector('.validation').addEventListener('core-change', function(e) {
console.log('validation core-change');
toast_element = document.getElementById('toast1');
toast_element.text = 'toast_element msg';
toast_element.show();
//On local - this is the error:
// ncaught TypeError: Cannot read property 'size' of null core-overlay.html:574
//solved with placing the code under setTimeout
setTimeout(function()
{
//toast call here
//toast_element = document.getElementById('toast1');
//toast_element.text = 'toast_element msg';
//toast_element.show();
},500);
});
</script>
Uncaught TypeError: Cannot read property 'size' of null core-overlay.html:574 Polymer.resetTargetDimensionscore-overlay.html:407 Polymer.transitionendcore-overlay.html:672 (anonymous function)polymer.concat.js:8391 b.firecore-transition.html:117 Polymer.completecore-transition-css.html:206 (anonymous function)core-transition.html:132 listener
document.querySelector(“.validation”).addEventListener('core-change',函数(e){
console.log(“验证核心更改”);
toast_元素=document.getElementById('toast 1');
toast_element.text='toast_element msg';
toast_元素.show();
//在本地-这是错误:
//ncaught TypeError:无法读取空核心覆盖的属性“size”。html:574
//通过将代码置于setTimeout下解决
setTimeout(函数()
{
//敬酒
//toast_元素=document.getElementById('toast 1');
//toast_element.text='toast_element msg';
//toast_元素.show();
},500);
});
未捕获类型错误:无法读取空核心覆盖的属性“大小”。html:574 Polymer.resetTargetDimensionscore覆盖。html:407 Polymer.transitionedCore覆盖。html:672(匿名函数)Polymer.concat.js:8391 b.firecore-transition.html:117 Polymer.completecore transition css.html:206(匿名函数)核心转换。html:132侦听器
我通过将paper toast.show()方法放在setTimeout下解决了这个问题
还注意到:
如果滑块被胶带固定到同一点,则会出现错误
如果slider是dragger,则没有错误您是否尝试将脚本放入
domReady
回调中?刚刚尝试过。我确实将“更改”事件insight“聚合物就绪”事件()。出现相同的错误-如果滑块被胶带固定到同一点,则会出现错误,如果滑块为拖动器,则不会出现错误。