From d28d3e653390aac9994e8b90d20fd6cddcc7a535 Mon Sep 17 00:00:00 2001 From: Szymon Fiedler Date: Fri, 22 Mar 2024 00:18:48 +0100 Subject: [PATCH] Remove autosubmit of matching stream name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It sounded cool to redirect instantly when we match stream with a text in the input, but behavior was pretty unpredictable. Co-authored-by: Ɓukasz Reszke --- ruby_event_store-browser/elm/src/Search.elm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ruby_event_store-browser/elm/src/Search.elm b/ruby_event_store-browser/elm/src/Search.elm index d3d5efaeb0..a64050c6b4 100644 --- a/ruby_event_store-browser/elm/src/Search.elm +++ b/ruby_event_store-browser/elm/src/Search.elm @@ -50,11 +50,6 @@ onQueryChangedCmd onQueryMsg stream = Task.perform onQueryMsg (Task.succeed stream) -isExactStream : Stream -> List Stream -> Bool -isExactStream stream streams = - List.any ((==) stream) streams - - hasAtLeastThreeChars : Stream -> Bool hasAtLeastThreeChars stream = String.length stream >= 3 @@ -64,12 +59,7 @@ update : Msg -> Model a -> ( Model a, Cmd a ) update msg model = case msg of StreamChanged stream -> - if isExactStream stream model.streams then - ( { model | value = emptyStreamName } - , onSelectCmd model.onSelectMsg stream - ) - - else if hasAtLeastThreeChars stream then + if hasAtLeastThreeChars stream then ( { model | value = stream } , onQueryChangedCmd model.onQueryMsg stream )