Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip processing prevented default key event #662

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

fcollonval
Copy link
Member

@fcollonval fcollonval commented Nov 30, 2023

This removes the processing of keydown event by the commands registry if it is prevented (aka already treated).

@fcollonval fcollonval added the bug Something isn't working label Nov 30, 2023
@brichet
Copy link
Contributor

brichet commented Dec 13, 2023

Thanks @fcollonval.

The code looks good, but I did not manage to test it in Jupyterlab.

I understood this PR is primarily to fix the codemirror search VS jupyterlab search, according to jupyterlab/jupyterlab#15459.

I tried to enable the codemirror search without success.
I can also see that the codemirror search is enabled by default for inline editor. Does it mean that the codemirror search should replace the jupyterlab search in Notebook, for instance ?

@fcollonval
Copy link
Member Author

Thanks for the review @brichet

It will not be easy to test on lab directly.

The main ground is that a keyboard shortcut event handled by codemirror can not be stopped, only marked as default prevented.

But in the generic sense, event that are default prevented should not be treated (except to do some stuff related to focused element changes).

Regarding the search, the search from code mirror has always be enabled in simple editor (easy way for us to provide a feature). But it must and it is deactivated in document (the cell editor required a special treatment as set in the lab pr).

@brichet
Copy link
Contributor

brichet commented Dec 13, 2023

Regarding the search, the search from code mirror has always be enabled in simple editor (easy way for us to provide a feature). But it must and it is deactivated in document (the cell editor required a special treatment as set in the lab pr).

Thanks, this is what I missed to test it.

Copy link
Contributor

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants