Michael Rabinovich Cursor commited on
Commit
326d20e
·
1 Parent(s): 6905c70

leaderboard: fix tasks iframe fit (use body.scrollHeight)

Browse files

documentElement.scrollHeight floors at the iframe viewport height, so the
previous fit never shrank a short detail card below the 90vh fallback (the
blank gap persisted). body.scrollHeight reflects the real content height;
verified the iframe now matches content on both desktop and mobile.

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (1) hide show
  1. tasks.py +4 -1
tasks.py CHANGED
@@ -510,7 +510,10 @@ let query = '', typeFilter = 'all';
510
  function fitFrame() {
511
  try {
512
  const fe = window.frameElement;
513
- if (fe) fe.style.height = Math.ceil(document.documentElement.scrollHeight) + 'px';
 
 
 
514
  } catch (e) { /* sandboxed -> keep fallback height */ }
515
  }
516
 
 
510
  function fitFrame() {
511
  try {
512
  const fe = window.frameElement;
513
+ // body.scrollHeight (not documentElement's) reflects the real content
514
+ // height; documentElement.scrollHeight floors at the iframe viewport, so
515
+ // it would never shrink a short detail card below the fallback height.
516
+ if (fe) fe.style.height = Math.ceil(document.body.scrollHeight) + 'px';
517
  } catch (e) { /* sandboxed -> keep fallback height */ }
518
  }
519