The Valid widget does not provide a way to control the readout style, as far as I can tell. This was originally raised in issue #1937 .
One way to do this would be to create a new ValidStyle object for the Valid widget that contains both the description_width and the readout_width fields. The ValidStyle object should probably inherit from DescriptionStyle.
Alternatively, we could make a new ReadoutStyle widget, with a corresponding readout_style traitlet on the Valid widget. This seems a bit more extensible in the future.
For a minimal example of the current (broken) behaviour:
import ipywidgets as widgets
widget = widgets.Valid(
readout='some very very long sentence about invalidity',
layout={'width': '700px'}
)
widget
The
Validwidget does not provide a way to control thereadoutstyle, as far as I can tell. This was originally raised in issue #1937 .One way to do this would be to create a new
ValidStyleobject for theValidwidget that contains both thedescription_widthand thereadout_widthfields. TheValidStyleobject should probably inherit fromDescriptionStyle.Alternatively, we could make a new
ReadoutStylewidget, with a correspondingreadout_styletraitlet on theValidwidget. This seems a bit more extensible in the future.For a minimal example of the current (broken) behaviour: