Basically, undo https://github.com/plotly/plotly.js/pull/7540 and do it properly.
Basically, undo #7540 and do it properly.