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

TextView AllowsReturn setter arbitrarily scrolls text out of sight #3988

Open
tznind opened this issue Mar 15, 2025 · 0 comments
Open

TextView AllowsReturn setter arbitrarily scrolls text out of sight #3988

tznind opened this issue Mar 15, 2025 · 0 comments
Labels
Milestone

Comments

@tznind
Copy link
Collaborator

tznind commented Mar 15, 2025

Describe the bug
When you set AllowsReturn the text you have set is scrolled completely out of the text views viewport leaving an empty text box. You have to press left to scroll the text back into focus.

To Reproduce

    [Fact]
    public void AllowsReturnShouldNotScrollView ()
    {
        var tv = new TextView ()
        {
            X = 1,
            Height = Dim.Fill (2),
            Width = Dim.Fill (2),
            Text =  "Heya",
            AllowsTab = false,
        };
        var top = new Toplevel ();
        top.Add (tv);

        tv.SelectAll ();
        Assert.Equal(1,tv.LeftColumn);
        tv.AllowsReturn = false;

// fails here
        Assert.Equal (1, tv.LeftColumn);
    }

Error is:

  Message: 
Assert.Equal() Failure: Values differ
Expected: 1
Actual:   5
@tznind tznind added the bug label Mar 15, 2025
@tznind tznind added this to the V2 Alpha milestone Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant