hotwired / hotwire-rails

Use Hotwire in your Ruby on Rails app
https://hotwired.dev
MIT License
971 stars 27 forks source link

Object don't destroy in browser when heavily styled #13

Closed AnthonyFrancis closed 3 years ago

AnthonyFrancis commented 3 years ago

I could be wrong, but I noticed objects don't destroy and are not removed from the browser when they are heavily styled with divs. Is this the case or did I miss something?

https://user-images.githubusercontent.com/3010099/104038758-69329400-51cd-11eb-90cb-a6689b3d4d4e.mov

seanpdoyle commented 3 years ago

It's difficult to tell from the source code in the video, but it appears that the original version's HTML nests the element with the id attribute deep within the hierarchy, whereas the second versions declares id on the root element.

AnthonyFrancis commented 3 years ago

Figured out the issue. The dom_id needed to be in the main div.