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

Auto scroll when cursor moves out of the screen inside the TextArea #3494

Closed
rodrigogiraoserrao opened this issue Oct 10, 2023 · 7 comments
Closed
Labels
enhancement New feature or request question Further information is requested

Comments

@rodrigogiraoserrao
Copy link
Contributor

When typing inside the text area, if you change lines and the new line is not visible, the screen should probably scroll so that the new line becomes visible.

Current behaviour:

Screen.Recording.2023-10-10.at.10.13.26.mov
@rodrigogiraoserrao rodrigogiraoserrao added enhancement New feature or request question Further information is requested labels Oct 10, 2023
@willmcgugan
Copy link
Collaborator

Is the text area off the bottom of the screen? What happens if you put a border around the text area? Do you see the bottom border?

@rodrigogiraoserrao
Copy link
Contributor Author

The text area is off the bottom of the screen, yes.
The bottom border is not visible, no.

Screen.Recording.2023-10-10.at.10.26.29.mov

@davep
Copy link
Contributor

davep commented Oct 10, 2023

Isn't this essentially a problem for all widgets that implement a cursor of some description? Or moreover, isn't this a styling choice within the app? For example:

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

class ScrollApp(App[None]):

    def compose(self) -> ComposeResult:
        yield OptionList(
            *[f"This is option {n}" for n in range(500)]
        )

if __name__ == "__main__":
    ScrollApp().run()

You could probably do similar with DataTable there too.

@willmcgugan
Copy link
Collaborator

Then I don't think it should scroll. It's too much to expect a widget to keep its cursor visible within its container.

@rodrigogiraoserrao
Copy link
Contributor Author

It's “too much” in what sense? Isn't this the expected behaviour?

@willmcgugan
Copy link
Collaborator

Maybe. But it seems a low priority. We can revisit it later.

@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants