Currently any pair of oneOf decoders are equal in the equality check that is used for diffing in virtual-dom. Because of this, changes in oneOf decoders are not reflected in event handlers of DOMs. (An example on Ellie)
Equality of two oneOf decoders are checked with _Json_listEquality(), which expects JavaScript arrays of decoders. However, a oneOf decoder has an Elm List of decoders instead of a JavaScript Array. Because of this, the len variable below becomes undefined given oneOf decoders, and the function always returns true for oneOf decoders.
Currently any pair of
oneOf
decoders are equal in the equality check that is used for diffing in virtual-dom. Because of this, changes inoneOf
decoders are not reflected in event handlers of DOMs. (An example on Ellie)Equality of two
oneOf
decoders are checked with_Json_listEquality()
, which expects JavaScript arrays of decoders. However, aoneOf
decoder has an ElmList
of decoders instead of a JavaScriptArray
. Because of this, thelen
variable below becomesundefined
givenoneOf
decoders, and the function always returnstrue
foroneOf
decoders.https://github.com/elm-lang/core/blob/bc067c8e3db20235fc275b1d825bb76f365a1509/src/Elm/Kernel/Json.js#L378-L398