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

Clicking blank part of TextArea scrollbar moves the cursor instead of scrolling #3763

Closed
godlygeek opened this issue Nov 27, 2023 · 3 comments · Fixed by #3778
Closed

Clicking blank part of TextArea scrollbar moves the cursor instead of scrolling #3763

godlygeek opened this issue Nov 27, 2023 · 3 comments · Fixed by #3778

Comments

@godlygeek
Copy link

godlygeek commented Nov 27, 2023

Reproducer:

from textual.app import App, ComposeResult
from textual.widgets import TextArea

TEXT = """\
def hello(name):
    print("hello" + name)

def goodbye(name):
    print("goodbye" + name + " I will miss you and can't wait until the day when we might one day meet again, perhaps bumping into each other at a bustling cafe in a city far from home, surprised by the serendipity of the encounter and overjoyed to reunite with an old friend")
"""


class TextAreaExample(App):
    def compose(self) -> ComposeResult:
        yield TextArea(TEXT, language="python")


app = TextAreaExample()
if __name__ == "__main__":
    app.run()

Run that program, and then click the black part of the horizontal scrollbar, to the right of the "slider" part. That should jump the slider to the right, but it instead moves the cursor to the last column of the first line. Clicking and dragging the slider works as expected, but clicking next to the slider doesn't.

Weirdly, clicking it several times in a row does seem to make it eventually scroll right as it should - but it also selects from the first line of the text area to the last.

I was able to reproduce this in a few different terminal emulators, so I'm pretty sure it's Textual itself at fault.

Textual Diagnostics

Versions

Name Value
Textual 0.42.0
Rich 13.7.0

Python

Name Value
Version 3.11.4
Implementation CPython
Compiler GCC 10.2.1 20210110
Executable /home/godlygeek/3ps/textual/venv/bin/python

Operating System

Name Value
System Linux
Release 6.1.62-08726-g0148b209c1d6
Version #1 SMP PREEMPT_DYNAMIC Sun Nov 12 18:54:23 PST 2023

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM Not set
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=80, height=24
legacy_windows False
min_width 1
max_width 80
is_terminal True
encoding utf-8
max_height 24
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

@willmcgugan
Copy link
Collaborator

Thanks. Should be fixed in 0.43.1 (just released)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants