Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Multi-line TextInput box? #2828
In general I've found it very difficult to find information on Bokeh widgets in the documentation, so maybe this is already possible, but is there a way to specify a paragraph-sized TextInput box? I'm using one for the user to be able to edit some code in a domain-specific language, which is awkward to do in a single-line box.
If multiple lines are not possible, is there at least a way to change the size of the box?
It looks like the TextInput box maps to an HTML input object, and I'd need an HTML textarea object in this case.
One complication is that the input object triggers a re-render based on pressing enter, but textarea would need to use enter internally. But there may be no problem with this, since both of them appear to trigger an update when the widget loses focus.
Another complication is that a textarea would need some sizing parameters to determine how large to make it. That might be a good reason to make a new type of Bokeh widget for multi-line input, rather than just adding a multiline=True option to TextInput.
Actually, needing to press return is an issue. I tested it out by hacking the textinput template to use textarea:
This works in terms of displaying the multi-line text and editing it, but I've defined a CustomJS callback for the textinput widget, and it apparently never gets called now, presumably because enter is now taken literally as a carriage return.