問題
ポリマーを 0.5 から 1.5 にアップグレードしたところ、紙のチェックボックスが 2 回表示されるようになりました。
進捗
polyup を実行して、ポリマー アップグレード ガイド全体を調べましたが、この問題を解決する手順はありませんでした。私は2つのことを見つけました:
1.
正しく動作している場合、htmlは次のようになります
paper-checkbox
checkboxContainer
checkboxLabel
私の場合、次のように見えました
paper-checkbox
checkboxContainer
checkboxLabel
checkboxContainer
checkboxLabel
これにより、ポリマーが紙のチェックボックスを2回処理していると思われます。ただし、再確認したところ、paper-checkbox.htmlを2回以上ロードしていません。これは、その面での私の唯一のアイデアでした。
2.
メイン コンテンツは、セクションが html インポートとして読み込まれるフライインにあります。インポートされた html の paper-checkbox がこの動作を示すことがわかりましたが、紙のチェックボックスをフライインにハードコーディングすると、正しく機能します。
質問
ポリマーが紙のチェックボックスを 2 回処理しようとする原因は何ですか? これを引き起こしている可能性のあるhtmlインポートはどうですか?
編集:
Tony の要求によるコード ダンプ。
default.html
<head>
<title>Title</title>
<meta charset="utf-8" />
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="styles//font-awesome.css?ver=v2.3.2-22-g83c2652" />
<link rel="stylesheet" type="text/css" href="scripts/jquery-ui/jquery-ui.min.css?ver=v2.3.2-22-g83c2652" />
<link rel="stylesheet" type="text/css" href="styles/main.css?ver=v2.3.2-22-g83c2652" shim-shadowdom />
<!-- favicon -->
<link rel="icon" type="image/ico" href="img/favicon.ico" />
<!-- HTML Imports -->
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" id="doc_nav" href="page/nav.html" onerror="handleError(event)">
<link rel="import" id="order_billing" href="page/billing.html" onerror="handleError(event)">
<link rel="import" id="order_submit" href="page/certify.html" onerror="handleError(event)">
</head>
<body>
// Some generic html then this, the section the imports are added to
<article class="fly-in transition-out">
</article>
// The relevant script
<script type="text/javascript">
// when imports are loaded, render starting page
window.addEventListener('HTMLImportsLoaded', function () {
init();
});
</script>
</body>
import.js 関連関数
// render all the pages of order type to the DOM then hide them
function renderOrderPages(){
var pages = document.querySelectorAll("link[id^='order_']");
var article = document.querySelector("article");
for (var i = 0; i < pages.length; ++i) {
var pg_content = pages[i].import;
var pg_section = pg_content.querySelector('section');
pg_section.style.display = "none";
article.appendChild(pg_section.cloneNode(true));
bind_page_events(pg_section.id);
}
}