Latest liveview and textarea problem

Hello everyone,

I have some strange behaviour with latest liveview and textarea. Selecting a text in a textarea triggers an update, and the form disappear…

I am on Mac OSX, with Erlang 22, Elixir 1.10.2, Phoenix 1.5.3.

The procedure to reproduce the bug is quite simple…

$ mix phx.new mvp --live
$ cd mvp
$ mix ecto.create
$ mix phx.gen.live Blog Post posts content:text
$ mix ecto.migrate
  • Update router and add posts routes
$ iex -S mix.phx.server
  • Navigate to localhost:4000/posts
  • Create a new post
  • Update this post
  • Select all text, update is triggered and the form disappear…

I made a MVP to show this…

This is only related to textarea, normal input works as expected.

Does anyone have the same problem?

Thanks in advance

I was only able to reproduce the issue by selecting all text with the mouse and releasing the mouse button outside the form modal. If I release the mouse button within the modal, the form stays.

1 Like

What browser(s)?

1 Like

I cannot recreate on OSX in chrome/FF/safari

I was able to recreate this with Chrome (Firefox worked fine) on Linux.

You need to start the select (no need to select the whole text) and release the select outside the modal (used the laptop’s touchpad). Maybe Chrome sees it as a click and thus closes the modal as it would happen normally?

1 Like

Ah I can indeed recreate with this scenario. @kokolegorille is this what you’re seeing? I’m not sure I would say this is unexpected or not.

1 Like

Sorry, I was away… thanks all for your responses.

This is what I am seeing, it happened when I tried to update a post, I selected and then the form disappeared. I did not thought of testing others browsers, but I can confirm it happens in Chrome, but not in FF.

It happens when You select text, then release mouse outside the modal. But it is very sensitive and it’s kind of easy to make this movement.

UPDATE: It happens when You click in the modal, and release outside. You don’t even need to select text, just start the click in the form, and release in grey area.

UPDATE2: It is a Chrome behaviour with modal, not with textarea, nor liveview. You can see some issue, like this one… https://github.com/ghosh/Micromodal/issues/216#ref-issue-559309976

There is nothing wrong with liveview, and the problem is not related. It is the expected way for Chrome, to deal with modal.

Thank You all for the help.