Plotly v6.0 figure resizing with ipywidgets

Hi there,

With new release of plotly 6.0 I am not able to make a Figure fill its container anymore. Maybe this has to do with the switch to Anywidget. I am using jupyterlab v4.3 and plotly 6.0.0rc0.

Can anyone help?

Example

import ipywidgets as widgets
import plotly.graph_objs as go
from ipywidgets import HTML, VBox

fig = go.FigureWidget(data=[go.Scatter(x=[1, 2, 3], y=[4, 5, 6])])

custom_css = """
<style>
.plot-container {
    width: 100%;
    height: 100%;
}
</style>
"""
fig.add_class("plot-container")

container = VBox(
    [fig],
    layout=widgets.Layout(
        width="500px",
        height="600px",
        border="solid red",
    ),
)

display(HTML(custom_css), container)

Plotly 5.24

Plotly 6.0.0rc0