jupyter / nbclassic

Jupyter Notebook as a Jupyter Server extension
https://nbclassic.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
73 stars 63 forks source link

pasting outside of cells always prevents default action #284

Closed iisakkirotko closed 3 weeks ago

iisakkirotko commented 3 months ago

Description

If a user tries to paste anything outside a cell, the paste function is called. This function checks if the user is attempting to paste cells into the notebook, but calls event.preventDefault regardless of whether that is the case or not. This means that if the objective is anything other than pasting cells into the notebook nothing will happen. This issue happens only with Jupyter notebooks - Jupyter lab behaves the expected way.

Reproduce

Run a notebook with this code in a cell:

import solara

@solara.component
def Page():
    solara.AppBarTitle("debug")
    solara.v.Textarea()

Page()

Then click on the full screen button on the top right of the output cell. Try to paste anything into the text field while the view is in full screen mode.

Expected behavior

Pasting into the text field works.