title: Elm update infinite loop
body: <p>New to Elm, so I may be missing something obvious.</p>
  
  <p>I'm working on an Elm application that uses <a href="https://package.elm-lang.org/packages/annaghi/dnd-list/latest/" rel="nofollow noreferrer">annaghi/dnd-list</a>. I'm encountering an infinite loop of calls to update. This happens when clicking on one element, then another one. Here's the code:</p>
  
  <pre><code>config : DnDList.Config Player
  config =
      { beforeUpdate = \_ _ list -&gt; list
      , movement = DnDList.Free
      , listen = DnDList.OnDrag
      , operation = DnDList.Swap
      }
  
  
  system : DnDList.System Player Msg
  system =
      DnDList.create config DndMsg
  
  
  type alias Model =
      { navKey : Nav.Key
      , room : WebData Room
      , dnd : DnDList.Model
      , startError : Maybe String
      }
  
  type Msg
      = RoomReceived (WebData Room)
      | DndMsg DnDList.Msg
  
  ...
  
  update : Msg -&gt; Model -&gt; ( Model, Cmd Msg )
  update msg model =
      case msg of
          RoomReceived room -&gt;
              ( { model | room = room }, Cmd.none )
          DndMsg message -&gt;
              let
                  room = model.room
              in
              case room of
                  RemoteData.Success actualRoom -&gt;
                      let
                          ( dnd, players ) =
                              system.update message model.dnd actualRoom.players
  
                          updatedRoom = RemoteData.map 
                              (\roomData -&gt; 
                                  { roomData | players = players }
                              ) room
                      in
                      ( { model | dnd = dnd, room = updatedRoom }
                      , system.commands model.dnd
                      )
                  _ -&gt;
                      ( model, Cmd.none )
  
  </code></pre>
  
  <p>When I change the line <code>system.commands model.dnd</code> to <code>Cmd.none</code>, then there is no infinite looping call to the update function, but also nothing happens. The message that keeps getting called in the dnd-list library is <code>GotDropElement (Ok dropElement)</code></p>
  
  <p>Again, new to Elm, so this may be a poorly formed question, but any help is appreciated.</p>
  
  <p>Thanks!</p>