If a legend is anchored to the container, the container sizes aren't taken into account when the legend sizes are computed. In the example [codepen](https://codepen.io/attatrol/pen/NWZgaRP) legends aren't visible fully and it is not possible to scroll then to the end. function [computeLegendDimensions](https://github.com/plotly/plotly.js/blob/55d8f983d45fe533596cd52a8526c78efda41e6b/src/components/legend/draw.js#L758) should take into account the container sizes for calculation of `_maxHeight` and `_maxWidth`