honestbleeps / Reddit-Enhancement-Suite

Reddit Enhancement Suite
http://redditenhancementsuite.com
GNU General Public License v3.0
4.09k stars 878 forks source link

Filtering a subreddit breaks expandos until a page refresh #4249

Open jonathanmcdougall opened 7 years ago

jonathanmcdougall commented 7 years ago

When a subreddit is added to reddit's filter, all expandos on the current page become unresponsive. A quick look at the DOM on Firefox shows an expando going from classes expando-button toggleImage image collapsed collapsedExpando linkImg to expando-button collapsed video. The event handlers are also removed. Looks like reddit may be rebuilding part of the DOM to remove the newly filtered subreddit. Reloading the page fixes it.

Reproduced on Firefox 53.0.2 (lots of extensions) and Chrome 58 (no extensions) on Windows 10 with RES 5.6.2. Not in reddit beta.

niralpokal commented 6 years ago

I can look into this if it is still a problem

jonathanmcdougall commented 6 years ago

@niralpokal It is. I just reproduced it again on Firefox 57, but I didn't check the DOM, so the details may have changed.

niralpokal commented 6 years ago

Sounds good, Ill see if I can get to the bottom of it

jewel-andraia commented 6 years ago

It should still be the same. IIRC the entire #siteTable element has its children replaced with a new post listing.

niralpokal commented 6 years ago

Sorry for the late update but I tried this last night on Firefox 57 on my mac and windows and I wasnt able to reproduce it. I toggled some of the expandos and the filtered the list by a subreddit. The expandos were still working for me and the class names didnt change. I am sure I am doing something wrong but can you give me the step by step instructions on how to reproduce? Thanks!

jonathanmcdougall commented 6 years ago
  1. Go on /r/all;
  2. Add the subreddit from the top post to the native filters.
  3. Wait a few seconds for the top post to disappear.
  4. Without refreshing the page or navigating away, find a post with an expando and click it.

Nothing happens here.

niralpokal commented 6 years ago

I was able to recreate it with those steps, thanks!