Skip to content

Commit

Permalink
🐛 Fix demo accessing null object in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoLegends committed Jun 5, 2018
1 parent e44860c commit 1dd09c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ <h3>Basic dom-flip demo</h3>
let counter = 5;

document.addEventListener('DOMContentLoaded', () => {
const flip = document.querySelector('dom-flip');

document.getElementById('btn').addEventListener('click', () => {
const flip = document.querySelector('dom-flip');
const it = Array.from(document.querySelectorAll('dom-flip p'));

while (flip.hasChildNodes()) {
Expand All @@ -50,6 +49,7 @@ <h3>Basic dom-flip demo</h3>
});

document.getElementById('btn2').addEventListener('click', () => {
const flip = document.querySelector('dom-flip');
const p = document.createElement('p');
p.setAttribute('data-flip-id', String(counter++));
p.textContent = `Row No. ${counter}`;
Expand Down

0 comments on commit 1dd09c9

Please sign in to comment.