From 210667ced60d52b7698c0bf16e0ec7884f32b7a1 Mon Sep 17 00:00:00 2001 From: Artus Date: Wed, 18 Dec 2019 15:45:06 +0100 Subject: [PATCH] makes filter search case insensitive --- src/Chest.elm | 2 +- src/Table.elm | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Chest.elm b/src/Chest.elm index 05158e7..0e919d4 100644 --- a/src/Chest.elm +++ b/src/Chest.elm @@ -111,7 +111,7 @@ view : Chest -> Loot -> Html Msg view model loot = let filterLoot txt ls = - List.filter (\i -> String.contains txt i.name) ls + List.filter (\i -> String.contains (String.toLower txt) (String.toLower i.name)) ls in case model of View filterText renderItem -> diff --git a/src/Table.elm b/src/Table.elm index cfcbccd..eff8c92 100644 --- a/src/Table.elm +++ b/src/Table.elm @@ -16,8 +16,7 @@ type alias ItemRenderer a msg = view : RowRenderer a msg -> List a -> Html msg view rowRenderer content = table [ class "table is-fullwidth" ] - [ thead [ class "table-header" ] - [ th [] [ text "Nom" ] ] + [ thead [] [ th [] [ text "Nom" ] ] , tbody [] <| List.map rowRenderer