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

[Bug] CTRL+F / Find does not work for offscreen content #4760

Open
1 of 2 tasks
chadsowald opened this issue Nov 22, 2024 · 0 comments
Open
1 of 2 tasks

[Bug] CTRL+F / Find does not work for offscreen content #4760

chadsowald opened this issue Nov 22, 2024 · 0 comments

Comments

@chadsowald
Copy link

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

The existing code in this existing sample demonstrates the issue:
https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.0#example-extending-language-services-configure-javascript-defaults

Monaco Editor Playground Code

The existing code in this existing sample demonstrates the issue:
https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.0#example-extending-language-services-configure-javascript-defaults

Reproduction Steps

  1. Visit
    https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.0#example-extending-language-services-configure-javascript-defaults
  2. Press CTRL+F (or find in page, etc)
  3. Type 'jscode' (no quotes)

It seems that anything off screen isn't considered for built-in browser search. My React app has embedded Monaco editors too and I found this same bug. I don't think each app that embeds Monaco should have to hook into the browser find-in-page and try to do custom code.

Actual (Problematic) Behavior

Actual:
Only finds 1 instance of 'jscode'

Actual screenshot:
Image

Expected Behavior

Expected:
Should find 2 instances 'jscode'. If I scroll just a bit lower down and repeat, it finds both:
Image

Additional Context

Please refer to this blog post that has some commentary on find-in-page support these days:
https://textslashplain.com/2024/07/15/browser-features-find-in-page/

I noticed it pointed out https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility as one way to address this. Not sure if Monaco can make use of that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant