question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScrollViewer "trims" bottom part of content.

See original GitHub issue

ScrollViewer (and controls that uses it) “trims” bottom part of content, when vertical scrollbar is visible. Some examples:

Without vertical scrollbar: without vertical scrollbar

With vertical scrollbar: with vertical scrollbar

As you see, some sentences are missed.

Code snippet, that can be used for reproducing a problem:

<ScrollViewer VerticalScrollBarVisibility="Auto">
    <TextPresenter Text="{Binding Text}" TextWrapping="Wrap" />
</ScrollViewer>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
grokyscommented, Jul 18, 2019

So you’re using TextPresenter in a control template, is that correct? I’m not able to reproduce this on master with the following xaml in ControlCatalog.Pages.TextBoxPage:

<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="ControlCatalog.Pages.TextBoxPage">
    <UserControl.Styles>
        <Style Selector="TextBox">
            <Setter Property="Template">
                <ControlTemplate>
                    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" >
                        <TextPresenter Name="PART_TextPresenter" TextWrapping="Wrap" Text="{TemplateBinding Text}" />
                    </ScrollViewer>
                </ControlTemplate>
            </Setter>
        </Style>
    </UserControl.Styles>
    <TextBox Width="200" Height="100" Margin="8">
        Multiline TextBox with no TextWrapping.&#xD;&#xD;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
    </TextBox>
</UserControl>

It could be that we’ve already fixed this since 0.8.1, or could be that your code is doing something different. Could you give some more details, or even a repro in ControlCatalog?

0reactions
grokyscommented, Oct 8, 2019

Closing this due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF ContentControl width grows but doesn't shrink when ...
I understand that in order for horizontal scrollbar to work the parent or child of the scrollviewer needs Width set, i guess i...
Read more >
ScrollViewer.ScrollToBottom Method (System.Windows. ...
Logical scrolling is used to scroll to the next element in the logical tree. This differs from physical scrolling, which scrolls content by...
Read more >
scroll-margin-bottom - CSS: Cascading Style Sheets | MDN
The scroll-margin-bottom property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport.
Read more >
scroll-padding-bottom - CSS: Cascading Style Sheets | MDN
The scroll-padding-bottom property defines offsets for the bottom of the optimal viewing region of the scrollport: the region used as the ...
Read more >
ScrollViewer Overview - WPF .NET Framework
Content within a user interface is often larger than a computer screen's display area. The ScrollViewer control provides a convenient way to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found