Allow previously diffed elements to be updated - #315
Conversation
tbranyen
commented
Jul 18, 2023
Holding off on merging this since I feel there is probably a better way of solving this. Clearly something is being disconnected when |
I noticed the test only fails once the inner span is set to 'Test 2' this means it's not actually a problem that the P tag was previously rendered. It looks to be an issue with rendering the span and it gets detached from the paragraph somehow. it('will support diffing an element with a StateCache',function(){constp=document.createElement("p");// Create the StateCache on <p/> diff.innerHTML(p,"<span>Test</span>");diff.innerHTML(this.fixture,p);// append p into the fixture div // commenting this out makes the test pass// diff.innerHTML(this.fixture.querySelector("span"), "Test 2"); diff.innerHTML(this.fixture.querySelector("p"),"<span>Test 3</span>");assert.equal(this.fixture.querySelector("span").innerHTML,"Test 3");});}); |
Removes a mount's transaction state when it is attached to another mount, via
Transaction.create. This allows it to be re-used as a mount in future transactions.FixesGH-314