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

Scrolling no longer works in 0.6.0 and 0.7.0 #1388

Closed
mitosch opened this issue Dec 18, 2022 · 6 comments
Closed

Scrolling no longer works in 0.6.0 and 0.7.0 #1388

mitosch opened this issue Dec 18, 2022 · 6 comments

Comments

@mitosch
Copy link

mitosch commented Dec 18, 2022

Maybe related to #1343

In 0.6.0 and 0.7.0 the scrolling with up, down, page up, page down seams to work different (or not as expected).

Steps to reproduce:

  • install textual 0.5.0
  • start demo: python -m textual
  • press down or page down
  • the screen moves down

In 0.6.0, 0.7.0 and main the screen does not move.

I've read the changes about PRIORITY_BINDINGS and tried to use it in my app, where I have a long list in a container with items (Item(Static, can_focus=True)) which used to behave the same as the demo. I tried to apply PRIORITY_BINDINGS to App, Screen and other Containers which should receive the scrolling actions without any luck.

As the demo behaves the same as my app, it could be a bug. Or am I missing something and a fix could be easy.

Thanks for any assistance.

@mitosch
Copy link
Author

mitosch commented Dec 18, 2022

Just detected another difference between 0.6.0 and 0.7.0:

In 0.6.0 key press on a focused input had a higher priority than key bindings on a Screen.

In 0.7.0 a Screen binding has a higher priority. This leads to the following scenario:

  • An Input on a Screen with a key binding a will no longer type a in the input, it will execute the action bound to the screen.

Just tell me, if should open a separate issue with a running example. At first, it looks related.

@davep
Copy link
Contributor

davep commented Dec 18, 2022

In 0.7.0 a Screen binding has a higher priority

That would be expected as it was decided that App and Screen have PRIORITY_BINDINGS=True by default. In this sort of situation, in my Screen, I'd PRIORITY_BINDINGS=False. Or, if you want most to have priority, simply set priority=False for the Binding of "a" should do the trick.

@willmcgugan
Copy link
Collaborator

The priority bindings should really be used for things like hot-keys only, think ctrl+C which you don't want to be consumed by an Input.

We need to rethink how bindings are handled. @mitosch we're aware of the problem. Leave it with us.

@mitosch
Copy link
Author

mitosch commented Dec 18, 2022

Thanks. Feel free to close the issue or change the title.

@mitosch
Copy link
Author

mitosch commented Dec 23, 2022

Retested: Fixed in 0.8.0.

@mitosch mitosch closed this as completed Dec 23, 2022
@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants