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

CodeMirror should be configured to use absolute positioning of tooltips #14857

Closed
krassowski opened this issue Jul 19, 2023 · 0 comments · Fixed by #14858
Closed

CodeMirror should be configured to use absolute positioning of tooltips #14857

krassowski opened this issue Jul 19, 2023 · 0 comments · Fixed by #14858
Labels
Milestone

Comments

@krassowski
Copy link
Member

Description

Tooltips are incorrectly positioned in CodeMirror editor, which affects at least jupyterlab-lsp and jupyterlab-spellchecker extensions.

This is because we use css contain. CodeMirror states in the docs:

By default, tooltips use "fixed" positioning, which has the advantage that tooltips don't get cut off by scrollable parent elements. However, CSS rules like contain: layout can break fixed positioning in child nodes, which can be worked about by using "absolute" here.

All we need to do is add an two liner CodeMirror extension: tooltips({position: 'absolute'}).

The alternative would be for each extension to add it but it would be wasteful - extensions should not need to worry about whether we use contain or not.

Reproduce

Hover over linter in reprex.

See codemirror/dev#1215

Expected behavior

Tooltips are positioned correctly, extensions don't need to do anything.

Context

  • JupyterLab version: 4.0.3
@krassowski krassowski added bug status:Needs Triage Applied to new issues that need triage labels Jul 19, 2023
@krassowski krassowski added this to the 4.0.x milestone Jul 19, 2023
@krassowski krassowski removed the status:Needs Triage Applied to new issues that need triage label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant