elm / virtual-dom

The foundation of HTML and SVG in Elm.
https://package.elm-lang.org/packages/elm/virtual-dom/latest
BSD 3-Clause "New" or "Revised" License
209 stars 80 forks source link

Logic bug in `_VirtualDom_applyFacts` #139

Closed hpate-omicron closed 6 years ago

hpate-omicron commented 6 years ago

I noticed this while reading through the code, the conditional checks on https://github.com/elm/virtual-dom/blob/master/src/Elm/Kernel/VirtualDom.js#L496 will always return true

(key !== 'value' || key !== 'checked' || domNode[key] !== value) && (domNode[key] = value);

Any string will pass key !== 'value' || key !== 'checked'

evancz commented 6 years ago

Some core team folks reviewed https://github.com/elm/virtual-dom/pull/135, and they tell me it should fix this. Can do a patch soon.