Tumblr widget not showing the latest posts/photos

Hi @Max, let me ask one question. On my Tumblr widget (https://2a12030814ee40459ee2f81d8cc54fa8.elf.site), when I click the last two photos (29th [floating shrine photo] and 30th [bridge photo]), the pop-up shows the third last image (28th). I’ve tested on a few desktop browsers (Firefox, Edge), but showing the same behavior. Would you mind kinldy checking and fixing? Thank you in advance.

1 Like

Hi there, @Joey_J :waving_hand:

Thanks for bringing this to our attention!

I’ve passed the issue on to the devs and will update you once it’s fixed :slightly_smiling_face:

1 Like

Hi there, @Joey_J :waving_hand:

The issue occurred because of the styles used in the Custom CSS field, We’ve fixed it using this script in the Custom JS field on the Settings tab:

const WIDGET_ID = '2a120308-14ee-4045-9ee2-f81d8cc54fa8';
const feed = document.querySelector(`.elfsight-app-${WIDGET_ID}`);

feed?.addEventListener('click', (e) => {
  const card = e.target.closest('[class*="CardContainer-sc"]');
  if (!card) return;

  const postLink = card.querySelector(
    '[class*="SourceLink__StyledLink-sc"]'
  )?.href;
  if (!postLink) return;

  setTimeout(() => {
    const postInPopup = document.querySelector(
      `[class*="${WIDGET_ID}"] [class*="Feed__PopupPost-sc"]:has([href="${postLink}"])`
    );

    postInPopup?.scrollIntoView();
  }, 500);
});

Please check your widget and let me know if it’s fine now :slightly_smiling_face:

Thank you @Max for your help. I’ve tested it, but the result is inconsistent — it works properly only about half the time. Any chance to fully fix? By the way, you mentioned this might be “because of the styles used in the Custom CSS field.” Could you please specify which style in particular is causing the issue?

1 Like

Hi there, @Joey_J :waving_hand:

Ah, I am so sorry about that! I see that the issue occurred again and passed it to the devs for further investigation. I’ll keep you updated :slightly_smiling_face:

Here is the style causing this issue:

.global-styles,
[class*="Feed__PopupPost"]:not(:nth-child(-n+30)),
[class*="Feed__PopupLoader"] {
  display: none;
}
2 Likes

Thanks for your help! By the way, my other Tumblr widget (https://d15eeb3eea8d4583bf22f501bcfff939.elf.site) doesn’t use this mentioned style, but the same thing is happening, too (by clicking the last two photos, the pop-up shows the third last image), so probably the style in question isn’t the cause? Thank you again.

1 Like

Thanks for sharing this insight!

I’ve passed this info on to the devs and will get back to you once I have any news :slightly_smiling_face: