diff --git a/app/src/Main.elm b/app/src/Main.elm index a6a1f44..54ce844 100644 --- a/app/src/Main.elm +++ b/app/src/Main.elm @@ -10,6 +10,8 @@ import Native.Event as Event import Native.Frame as Frame import Native.Layout as Layout exposing (rootLayout) import Native.Page as Page +import Process +import Task type alias Flick = @@ -302,7 +304,7 @@ detailsPage model = Just flick -> Page.pageWithActionBar [ Event.on "navigatedTo" (D.field "isBackNavigation" D.bool |> D.map Back) ] (Native.actionBar [ NA.title flick.title ] - [ Native.navigationButton [NA.text "Back"] [] + [ Native.navigationButton [ NA.text "Back" ] [] ] ) (Layout.scrollView diff --git a/elm-native-js/Native/Elements.res b/elm-native-js/Native/Elements.res index c98c1d5..1652df5 100644 --- a/elm-native-js/Native/Elements.res +++ b/elm-native-js/Native/Elements.res @@ -319,10 +319,8 @@ module ListView = { current.data ->Js.Nullable.toOption ->Belt.Option.forEach(data => { - if !Belt.Array.eq(data.items, newItems, (x, y) => x == y) { - data->Types.setItems(newItems) - data->Types.refresh - } + data->Types.setItems(newItems) + data->Types.refresh }) } ) diff --git a/elm-native-js/Native/Helper.res b/elm-native-js/Native/Helper.res index fd36aed..53e9f53 100644 --- a/elm-native-js/Native/Helper.res +++ b/elm-native-js/Native/Helper.res @@ -87,7 +87,11 @@ let addView: (. Types.htmlElement, Types.htmlElement) => unit = %raw(` getExpression(parentElement.getAttribute("item-template-selector")) parentElement.data.itemTemplateSelector = ($value, $index, _) => { - return eval(expression) + // Mangling the variable can affect the variables used in the expression + const replacedExpression = expression + .replaceAll("$value", Object.keys({$value})[0]) + .replaceAll("$index", Object.keys({$index})[0]) + return eval(replacedExpression) } parentElement.data.itemTemplates = keyedTemplates return