Open eggroll-bot opened 4 years ago
Avalonia 0.9.9
I have also seen this where a Button
click is ignored if a TextBox
has focus and is scrolled off screen and the button is inside the same ScrollViewer
.
Instead the ScrollViewer
scrolls the TextBox
back into view.
Clicking the button again then fires the command correctly.
Avalonia 11.0.5.
I have this AXAML code:
<Border Grid.Row="2" Grid.ColumnSpan="2" Classes="loadingStatusBorder">
<ScrollViewer Name="LoadingStatusScroll">
<SelectableTextBlock Classes="normal" Name="LoadingStatusText"/>
</ScrollViewer>
</Border>
When I try to focus the text and then make the scroll viewer get the focus, this line of code brings the text into view, which somehow causes the scroll viewer to scroll to the start (even if the text is visible).
Avalonia 11.0.5.
I have this AXAML code:
<Border Grid.Row="2" Grid.ColumnSpan="2" Classes="loadingStatusBorder"> <ScrollViewer Name="LoadingStatusScroll"> <SelectableTextBlock Classes="normal" Name="LoadingStatusText"/> </ScrollViewer> </Border>
When I try to focus the text and then make the scroll viewer get the focus, this line of code brings the text into view, which somehow causes the scroll viewer to scroll to the start (even if the text is visible).
I had this problem too, but I found that you can set the BringIntoViewOnFocusChange
property of the ScrollViewer
to false
to prevent it from doing this.
It's possible that the issues reported by the other users above could be resolved by doing this too, but I haven't tested.
When a textbox with focus is outside of the immediate view, in a ScrollViewer, having the textbox lose focus (which can be done by selecting another object) makes it so that the ScrollViewer will jump back up to the textbox and deselect it. Is this intended behavior? And if so, is there a way to disable such functionality?