panel icon indicating copy to clipboard operation
panel copied to clipboard

CodeEditor - Enter key press does not trigger newline on Jupyter Lab

Open avivazran opened this issue 1 year ago • 2 comments

Thanks for contacting us! Please read and follow these instructions carefully, then delete this introductory text to keep your issue easy to read. Note that the issue tracker is NOT the place for usage questions and technical assistance; post those at Discourse instead. Issues without the required information below may be closed immediately.

ALL software version info

bokeh==3.4.2 panel==1.4.5 param==2.1.1 jupyter==1.0.0 jupyter_bokeh==4.0.5 ipywidgets_bokeh==1.6.0 jupyterlab==4.2.4 jupyterlab_widgets==3.0.11

windows 10 browser: edge

Description of expected behavior and the observed behavior

on widget focused and enter key pressed: in documentation web page: newline (expected) in Jupyter lab - nothing

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
import param

pn.extension('codeeditor')
py_code = "import sys"
editor = pn.widgets.CodeEditor(value=py_code, sizing_mode='stretch_width', language='python', height=300)
editor

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

  • [ ] I may be interested in making a pull request to address this

avivazran avatar Aug 08 '24 08:08 avivazran

I can confirm, the same happens to me on latest JupyterLab v4.2.4 and latest MacOS Sonoma v14.6. It happens randomly - i.e. from beginning it works and then, (after some completely random time like 30 minutes) it stops working = pressing Enter does nothing - no newline. It looks to common user like Enter presses are ignored.

What helps is to close the notebook and reopen it again. Then Enter starts working again normally. It is pretty annoying and happens like 2-3 times per day.

I believe, this is more problem of JupyterLab in general, not holoviz here.

stefansimik avatar Aug 09 '24 11:08 stefansimik

We've had a number of issues with JupyterLab capturing key-presses inside our components. We've added mitigation around this but this sounds like it might be something else entirely.

philippjfr avatar Aug 09 '24 13:08 philippjfr