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

[Problem/Bug]: Text fragment highlighting stays visible on same-page navigation #4835

Closed
Optimierungswerfer opened this issue Sep 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Optimierungswerfer
Copy link

What happened?

When navigating to a URL that contains a text fragment to highlight some text on that page and then navigating to the same URL but with a different text fragment to highlight some other text on that page, the previous highlighting does not get cleared and stays visible, even though the new URL contains only the new text fragment. Since it is actually possible in the text fragment standard to highlight multiple text passages at once by specifying all of them in the URL, I consider this a bug, because I explicitly do not list the old text fragment in the new URL, yet its highlighting remains in addition to the new one.

This reproduces in Edge, see the repro steps below.

Since we use that feature to natively (as in "no Javascript shenanigans") highlight and scroll to different parts of a page we cannot accept the old highlighting to remain visible. Our current workaround is to perform a brief intermediate "clearing" navigation to the same URL without any text fragment at all, and then to the URL with the new text fragment. This clearing navigation gets rid of any highlighting, however it briefly scrolls the page to the top (as expected) before the following navigation highlights the actual new text fragment. This "flickering" is quite bad UX and also not the most stable approach, because since there is no completed handler for the WebView2 Navigate API, we need to temporarily register a NavigationCompleted event handler which continues with the actual navigation to the URL with the new text fragment and then remove it again.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

129.0.2792.52

SDK Version

1.0.2792.45

Framework

Other

Operating System

Windows 11

OS Version

22631.4169

Repro steps

In Edge or WebView2 visit
https://www.wikipedia.org/#:~:text=Encyclopedia
Then in the same tab visit
https://www.wikipedia.org/#:~:text=The

Expectation: Only "The" should be highlighted.
Actual: "The" and "Encyclopedia" are highlighted.

Repros in Edge Browser

Yes, issue can be reproduced in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@Optimierungswerfer Optimierungswerfer added the bug Something isn't working label Sep 25, 2024
@vbryh-msft
Copy link
Contributor

vbryh-msft commented Sep 26, 2024

If you think it is Edge browser problem - you should report it using Feedback tool in Edge (... -> Help and feedback -> Send feedback, or alt + shift + i) - it will find the owners faster. 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

No branches or pull requests

2 participants