Bouncing legend

I have dozens of curves. I’m using a vertical legend. It populates fine, and creates a scroll-bar so that I can pick traces. If it is pertinent, I have:: legend: {xanchor: left, yanchor: bottom, x: 1.5, y: 0.}, margin: { l: 80, r: 100, b: 20, t: 20, pad: 4}

All is good except. When I first load the page the legend decides to be at half-height, only occupying the bottom-right of the figure. Scrolling works. Everything works. But then if I click on the legend (whitespace, or a trace label), then the legend bounces up to full size, i.e., now straddling the full vertical extent. Any clicking after that keeps the same height.

Is there a parameter to always set the legend to the full height?

I was wrong. It is not always half-height. In this example it has set the legend height close to zero.

As I describe above, if I click on the legend then it bounces up perfectly into position.