LiveView disconnect handling

Hi all,

We are considering to use LiveView in a next project and the question came up about unstable internet connection and how LiveView handles it.

As I remember from @chrismccord presentation, the LiveView area would have an overlay until the connection was restored. For our use-case we want to create a form in a LiveView and it would be inconvenient if in the middle of the form it would be disabled by an overlay. Is there a flexible way to handle it? Maybe I just want to disable the submit button and show a message under it that the user should wait for connection to restore.

Also is there a best practice already how not to lose data entered in the form if a disconnect happens? localStorage?

Hi @egze,

I think that handling the situation you describe is a work in progress for the liveview team. There is some discussion towards the end of this thread: New questions about LiveView based on Chris' keynote from ElixirConf 2019, and the following discusses a related issue: (which includes an example on how to reapply client side form state to the liveview on reconnection).

1 Like

Thanks. Good to know that it is being worked on.