turbo_power-rails icon indicating copy to clipboard operation
turbo_power-rails copied to clipboard

Please clearify «targets»

Open chmich opened this issue 1 year ago • 1 comments

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 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

chmich avatar Apr 25 '23 11:04 chmich