You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of your functions have the first attribute: targets.
I made a test on turbo_frame_set_src and noticed that its interpreting a simple string as id, because: #cars-box does not work while cars-box successfully targets the element with the id cars-box.
So under targets I would expect that a value like .cars-box would affect all matching elements as it would be the case with jquery.
Could you please clarify this?
On my gem, which includes yours in many cases, I kept the same naming because I thought target was a good naming for what it means, but clarified that target has a value like #my-target in logs, for example.
And why not allow css matchers like .customer-wrapper > #form? Yes, html-id should be unique, but this is hard to control and for complex pages child selectors would be a help.
Thanks,
Chris
The text was updated successfully, but these errors were encountered:
I want to add to this that I was also quite confused. Turbo-Rails always supports two possible variants:
turbo_stream.replace("myid") # Will target a single node with id="myid"
turbo_stream.replace_all("#myid") # Will target all nodes with id="myid" (still only one as IDs need to be unique)
Note the usage of # in the second example, but not in the first example.
So, when using turbo_stream.morph, I thought that I had to use "myid" as target, but actually needed to specify "#myid", which is confusing.
Anyway, thanks for your efforts, I now have the morphing working like a charm 😊
Hi,
Many of your functions have the first attribute:
targets
.I made a test on
turbo_frame_set_src
and noticed that its interpreting a simple string as id, because:#cars-box
does not work whilecars-box
successfully targets the element with the idcars-box
.So under
targets
I would expect that a value like.cars-box
would affect all matching elements as it would be the case with jquery.Could you please clarify this?
On my gem, which includes yours in many cases, I kept the same naming because I thought
target
was a good naming for what it means, but clarified that target has a value like#my-target
in logs, for example.And why not allow css matchers like
.customer-wrapper > #form
? Yes, html-id should be unique, but this is hard to control and for complex pages child selectors would be a help.Thanks,
Chris
The text was updated successfully, but these errors were encountered: