Open dsanders11 opened 2 years ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.72.2. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
Hey can I get this assigned
@K0more, no need to have the issue assigned to you. You're welcome to make a PR to fix it if you want. 🙂
@dsanders11 I tried digging into the issue and found that because it is an in-place reload of the Preview, the scroll bar tries to get back to its original position after rerendering. Do you recommend opening a new tab for the linked document's preview, that would ideally solve the issue.
P.S. I tried setting the StartScrollLine
number of the linked document to 0
before rerendering but it didn't seem to work.
cc. @mjbvz
Hello, I'm new to Open Source development and I was going through the Good First Issue label and figured I could take a crack at this one.
I think I have traced the problem back to this section of code, but I'm not sure how to proceed.
This is in the file "extensions\markdown-language-features\preview-src\index.ts"
It seems the scrollProgress of a preview window is stored in a state variable and when the link is clicked, the scrollProgress is restored using that piece of code. I'm not sure if that is intended behavior, or a bug fix for another issue.
Commenting out line 65 actually solves the issue, but again, I am not sure if the line was added for some other bug fix or intended behavior, since the commit message for that line does not specify a bug fix.
cc: @dsanders11
@dsanders11 hi, i have a question about Testing "/src/vs/workbench/contrib/webview/browser/pre/index.html"
i want to fix some of code there. but when i fixed then run complie-web, it's not changed!
how can test this point ?
i run
1. yarn
2. code change ...
3. npm run compile-web
4. npm run gulp
5. ./script/code-web.sh
Reopening since the PR that fixed this had to be reverted: #168224
This still repros for me :(
Actually I probably need to fix this for this iteration as the code now appears to be setting the webview state incorrectly
The preview did not scroll to the top:
@rzhao271 Which commit did you test on? This fix just went in and is only in deedbd33f5dc57795e11da7c2a26b5a05a93485b
I am on deedbd33f5dc57795e11da7c2a26b5a05a93485b
@mjbvz - is this fixed now?
Does this issue occur when all extensions are disabled?: N/A (depends on the built-in markdown extension)
Steps to Reproduce:
Expected Behavior:
The link to the other document should open the new document at the top
Actual Behavior:
The scroll position stays the same, opening the new document at a random spot in that document
Other Information:
This change is probably straightforward to make, but it would break the existing behavior. I'm struggling to imagine why that behavior would be desirable though, so not sure it would actually affect anyone in a meaningful way.
cc @mjbvz