I just ran into this problem. And the work around was pretty simple, and
mentioned in a message in this group a while back.
textarea [
property "defaultValue" (Json.Encode.string model.body)
, onInput UpdateBody
, rows (model.cursorAperture * 2)
, id "edit-glass"
, class "form-control"] []
]
I used defaultValue instead of value. I think the textarea and the various
frameworks fight each other when 'value' is used, so you get the jumpiness
going on. I think it's because Elm is keyed off of 'value' for updates.
This way, the textarea maintains its own state, and when it changes, it
doesn't trigger a re-render from Elm for the textarea itself.
On Saturday, December 3, 2016 at 11:08:38 AM UTC-8, Esteban Manchado
Velázquez wrote:
>
> Hi,
>
> I have a strange, intermittent issue with textareas. It mostly seems to
> happen in mobile browsers. The issue is that, when editing text *in the
> middle* of a textarea, as opposed to adding to the end, sometimes the
> cursor jumps to the end. I assume it's some kind of re-creation of the
> textarea DOM element.
>
> I have made a simple application with a textarea but that DOES seem to
> work fine... so I'm wondering if the problem happens because my application
> is bigger, and I have "subapplications" that use App.map for messages and
> so on.
>
> Has anyone seen that before? Is it something stupid I'm doing, a bug in
> Elm, ...? I can make the full source code available if that'll help.
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.