I am trying to get TextAreaInput to callback when the user hits ENTER, which works in a TextInput, but does not in a TextAreaInput. Perhaps because TextAreaInput is multiline that the ENTER doesn’t behave the same way intentionally?
Here is a minimal snippet that demonstrates the issue. After the page loads, open the inspect window and view the console. Type some text in both inputs and hit Enter, only the TextInput triggers the callback.
from bokeh.layouts import layout, column
from bokeh.models.widgets import Div
from bokeh.io import show
from bokeh.models import TextInput, CustomJS, TextAreaInput
ti = TextInput(title="ti")
callback = CustomJS(code="""console.log("hello ti");""")
ti.js_on_change("value", callback)
tia = TextAreaInput(title="tia")
callback = CustomJS(code="""console.log("hello tia");""")
tia.js_on_change("value", callback)
doc_layout = layout()
doc_layout.children.append(column(Div(text="""<h1>Hello World!</h1>""")))
doc_layout.children.append(ti)
doc_layout.children.append(tia)
show(doc_layout)
Okay, wait a minute. If I press TAB (or click outside the box), the callback is triggered. Obviously Enter is handled differently. Still posting this in case it helps somebody else.