I'm using the best_in_place gem on several textareas and sometimes (seemingly randomly) the textarea 'jumps' and triggers the blur event when I click save, prompting the "discard your changes" warning.
Here's the code:
<p>
Administrator Notes (<%= link_to 'Edit', '#', id: 'edit_notes_link', onclick:
'event.preventDefault()' %>)
</p>
<div class="panel radius">
<%= best_in_place [:admin, @booking], :notes, type: :textarea, ok_button:
'Save', cancel_button: 'Cancel', activator: '#edit_notes_link', display_with:
:simple_format, nil: '<i>None</i>' %>
</div>
And here's a GIF of the behaviour:
(And the video that GIF was taken from)
I'm guessing that there's some JavaScript skulduggery going on somewhere but I don't know where to begin debugging it. If you've seen Best in Place behave like this or you have some pointers for how to debug it then I'd really appreciate some help.