Describe the bug
If I'm using anything selection based like tabs or options which has a node with a zero index that node will get deleted.
I think the reason lies in line 96.
https://github.com/dmjio/miso/blob/69f50b49adbff8217f8b51ae5f47727ee950f204/jsbits/diff.js#L94-L96
If newProp = 0 holds then this check will fail however zero is a valid value for a new prop.
I think newProp === undefined is probably the check that comes sematically the closest without deleting props with zero value.
Describe the bug If I'm using anything selection based like tabs or options which has a node with a zero index that node will get deleted. I think the reason lies in line 96. https://github.com/dmjio/miso/blob/69f50b49adbff8217f8b51ae5f47727ee950f204/jsbits/diff.js#L94-L96 If
newProp = 0
holds then this check will fail however zero is a valid value for a new prop. I thinknewProp === undefined
is probably the check that comes sematically the closest without deleting props with zero value.To Reproduce Either run https://github.com/developandplay/material-components-web-miso locally or check out our demo website matiso.dev. Then select the first option as shown in the screenshots below and look at the error in the console.
Expected behavior If a
newProp = 0
occurs it should be treated as a prop with valid content.Screenshots Expected behaviour when selecting the second option.
node[c] = newProp;
gets executed.Unexpected behaviour when selecting the first option.
node[c] = '';
gets executed.Desktop (please complete the following information):