Fix layout calculation when totalHeight is undefined