Multi-line TextInput box? #2828
Comments
Right now, the TextInput box accepts multi-line strings, but the newlines just show up as spaces, with everything still on one line. |
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. |
This has to be implemented as a separate widget, so that we don't mix concerns. I may actually do it as part of custom models work, because this touches some interesting issues. |
Interesting sounds scary! :-) I'd wished for easy and boring. |
a shame mas-dse-pjmulroo's PR did not work. Is there any plans to make a widget like this in the future? |
What would be a simple way of adding a multiline text input to a bokeh app? (If it's of relevance - it's supposed to accept an SQL query, and display results in a DataTable widget) Thanks, |
Hi Team, is this issue fixed? |
Yes, there is a TextAreaInput widget. |
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?
The text was updated successfully, but these errors were encountered: