Skip to content

Commit

Permalink
clear light dom after reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
pemrouz committed Apr 20, 2016
1 parent 21e6077 commit 045fa04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var render = function render(next) {
};

var reflect = function reflect(el) {
return el.shadowRoot.innerHTML = el.innerHTML;
el.shadowRoot.innerHTML = el.innerHTML;
el.innerHTML = '';
};

var retarget = function retarget(el) {
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const render = next => el => {
return next(el)
}

const reflect = el => el.shadowRoot.innerHTML = el.innerHTML
const reflect = el => {
el.shadowRoot.innerHTML = el.innerHTML
el.innerHTML = ''
}

const retarget = el => keys(el)
.concat(['on', 'once', 'emit', 'classList', 'getAttribute', 'setAttribute'])
Expand Down
1 change: 1 addition & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Shadow DOM', function(){
ripple.render(el2)

expect(el2.shadowRoot.innerHTML).to.be.eql('fallback')
expect(el2.innerHTML).to.be.eql('')
})

it('should close gap between host data and shadowRoot data', function(){
Expand Down

0 comments on commit 045fa04

Please sign in to comment.