KEMBAR78
Assembly Pane's scroll position may jump around when clicked without focus. · Issue #3381 · icsharpcode/ILSpy · GitHub
Skip to content

Assembly Pane's scroll position may jump around when clicked without focus. #3381

@UnluckyNinja

Description

@UnluckyNinja

Steps to reproduce

  1. Open any assembly, then expand some members until you can scroll it for 2~3 page long.
  2. Click one node, then click code pane to focus it.
  3. Hover over the assembly pane (don't click yet), scroll until you can't see selected node.
  4. Click a new node, you will see it scrolling back to the old one, while the new one has been selected.

Expected

Newly selected node should be scrolled to rather than the old one. (Or just don't scroll because if you select it by mouse directly, you must have it in view at that moment.)

Better solutions could be:
A: Scroll the pane into selected node when the code pane becomes active, rather than the assembly tree. (And can be turned off by option/toolbar)
B: Allow users to disable auto scrolling, and provide a toolbar button to scroll to current opened node.
Either way, I think to scroll or not should be decided at initiator side.

Details

  • Product in use: ILSpy
  • Version in use: 9.0.0.7889+e94eb917395e50c74ea363a79df3514538989daa
  • Any other relevant information to the issue, or your interest in contributing a fix.

It might be these lines conflicting with selection related stuff:

else if (e.Property == Pane.IsActiveProperty)
{
if (!true.Equals(e.NewValue))
return;
if (SelectedItem is SharpTreeNode selectedItem)
{
// defer focusing, so it does not interfere with selection via mouse click
this.BeginInvoke(() => FocusNode(selectedItem));
}
else
{
Focus();
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions