The begin_child() was using (0, -40) which made it stretch to fill parent. Changed to (0, min(len(items) * 30 + 50, 300)) so it: - Sizes to content (30px per row + 50px header) - Caps at 300px max height - Allows scrolling when content overflows