Closed mmhan closed 4 months ago
It looks like the value is set here, via connect()
. I believe connect()
is never recalled for turbo morphing. Not sure how one would go about resolving this bug yet.
Great catch! Thanks for the report. Fixed in https://github.com/josefarias/hotwire_combobox/pull/132
I'm using this gem together with turbo's morphing turned on. Everything seems to be working perfectly except there is one problem with
prefilled_display_value
.Although turbo did morph the component (the
<fieldset>
) the value inprefilled_display_value
does not show up as prefilled.Steps to reproduce the behavior:
Post
withbelongs_to :category
%meta{name: "turbo-refresh-method", content: "morph"}
(haml)posts#new
set up the post with a default category -@post = Post.new category_id: params[:category_id]
prefilled_display_value
exist in returned HTML inposts#new
and that the combobox shows the prefilled category's name in combobox<input>
posts#create
with some validation errors in it. Perhaps an empty title.fieldset
hasprefilled_display_value
is the same category name as before.Expected behavior
prefilled_display_value
should show up in combobox<input>
Screenshots![Screenshot 2024-03-30 at 11 53 17](https://github.com/josefarias/hotwire_combobox/assets/301672/3c8f247a-c8ec-4e46-b5d5-3630382810d9)
Sidenote: It looks as though there is no actual
input[value]
attribute for both cases (with or without morph). I wonder how the prefilled value was used to display it.