Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix iframe resize on auth dropdown opening #1490

Merged
merged 1 commit into from
Sep 21, 2022
Merged

Conversation

akellbl4
Copy link
Collaborator

Mutation observer was listening for all of the elements. When Auth dropdown appears it renders images and triggering height recalculations.
Resize trigger on image load was introduced in favor of resizing iframe for users with slow internet (when images load later and we need to resize iframe accordingly)

Solution:
Listen to mutations only on block with comments.
Plus remove unnecessary triggers.

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Base: 58.12% // Head: 58.07% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (1d41e81) compared to base (ffcef2f).
Patch coverage: 4.76% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1490      +/-   ##
==========================================
- Coverage   58.12%   58.07%   -0.06%     
==========================================
  Files         131      131              
  Lines        2909     2910       +1     
  Branches      743      743              
==========================================
- Hits         1691     1690       -1     
- Misses       1214     1216       +2     
  Partials        4        4              
Impacted Files Coverage Δ
...rontend/apps/remark42/app/components/root/root.tsx 0.00% <0.00%> (ø)
...nd/apps/remark42/app/components/auth/auth.hooks.ts 92.30% <100.00%> (-0.10%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

size-limit report 📦

Path Size
public/embed.mjs 2.03 KB (0%)
public/remark.mjs 72.54 KB (+0.03% 🔺)
public/remark.css 8.15 KB (0%)
public/last-comments.mjs 35.64 KB (0%)
public/last-comments.css 3.72 KB (-0.03% 🔽)
public/deleteme.mjs 12.05 KB (0%)
public/counter.mjs 749 B (0%)

@paskal
Copy link
Collaborator

paskal commented Sep 15, 2022

I installed it on https://terrty.net/2022/self-hosted-comments-remark42/

Safari, Chrome first load in Incognito:
image
After refresh:
image

@akellbl4
Copy link
Collaborator Author

@paskal thank you for testing the fix. I see in prod env it behave slightly different.
Probably should be a good idea to introduce e2e here

@umputun umputun merged commit 8e96aa2 into master Sep 21, 2022
@umputun umputun deleted the fix-iframe-resize branch September 21, 2022 15:56
@akellbl4 akellbl4 restored the fix-iframe-resize branch October 1, 2022 18:34
@paskal paskal added this to the v1.10.2 milestone Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants