Description
jsfiddle repro here: https://jsfiddle.net/6oq39dpy/3/
Normally, when a horizontal legend contains many items, they get wrapped onto multiple lines.
However, if legend groups are used at all -- even if only a single item is assigned to its own legend group -- nothing is wrapped, and legend items extending beyond the width of the plot are invisible and inaccessible.
To make wrapping appear again in the jsfiddle repro, just comment out line 10, which sets a legend group for the first trace.
While searching for an already open issue for this, I found #769, which led to the original PR that added support for wrapping horizontal legends in the first place, and mentions legend groups, but only as a workaround for the original problem. I've only skimmed the related code so far so I don't know exactly what causes the bug. :-)