Click event for legend text on editable plot

When you make the plot editable, you can edit the legend text by clicking on it. Now I want to catch that newly entered text programmatically. I tried with relayout, but it doesn’t work. Although plotly_legendclick is triggered on clicking the legend, but how to catch the text after one is done entering the text? What event is emitted while editing the legend text?

Try listening to plotly_restyle, editing the legend text is equivalent to calling:

Plotly.restyle('graph', 'name', /* new trace name */)