-
Notifications
You must be signed in to change notification settings - Fork 843
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
Issues with new Footer #4930
Comments
When a widget has focus, it's bindings take precedence. The input binds If you set The binding to quit the app is a bit of an edge case. Clicking the footer simulates the key. When the Input has focused, that of course produces a "q". If you set |
Thanks for the details. |
Maybe. But simulating the key when you click the footer does mean that it goes through the same logic. If clicking ran the action, then you have this strange situation where pressing the key could have a different effect to clicking the footer. Like in the I think the best solution may be to trust the dev to pick keys that don't clash. If you have Inputs, then your app/screen bindings should have a modifier, like |
I don't think it's ever a reasonable expectation that clicking an action in the footer would insert text into an Input rather than running the action. Wouldn't the vast majority of users expect the app to quit if they click a button that says "Quit"? |
They would also expect when the footer says "q Quit" that pressing "q" would quit. But it won't if the input is consuming the printable keys. We could have something on the widget that declares it will consume printable keys. That way we would know to hide the key from the footer. |
I agree, a child widget consuming a key should lead to the corresponding action being hidden in parent widgets. |
I think having some flag just saying the widget consumes printable keys is reasonable! |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
I almost opened another issue to share this:
My expectations are:
Point 2 is important as it highlights the assumption that the footer should display available actions rather than available keybindings. If the keybinding cannot be used, maybe this could be reflected through a visual change, but that seems optional to me: most users typing into a text field/area quickly realise that limitation. |
Hi @xavierog There is a solution to this in main. Widgets can declare they will consume a key before the bindings are processed with |
So the user has to make sure |
@davidbrochart Pretty much. |
It is only really a concern with widgets that don't exclusively use bindings. In the core lib that is only Input and TextArea. |
Hi @willmcgugan To address this issue, I think it is important to focus on intuitive behaviours. Here,the most important of those has been expressed by David:
As to:
You are correct, it is a strange situation. But it's okay, really. Specifically:
They expect the key they have pressed to do the right thing ©. Here, the right thing is to append the right character to the current Input/TextArea widget because typing text is fundamental and thus overrides everything else. If they are not typing text (i.e. a non-input widget is focused), then of course, the keybinding and its action should be triggered. What do you think? |
The footer is intended to show what you can do with the keyboard (or at least a subset). The fact that you can click it with the mouse is a convenience, but should never be the primary interface. Having the possibility of "mouse only" actions violates that. I also think that pressing the key should have exactly the same behavior as clicking the footer. Not usually, but always. If pressing Ultimately though, this should rarely be an issue. Devs can pick keys that don't clash. |
I completely agree with Will on this, for what it's worth. The |
@xavierog didn't mean to sound combative. I appreciate your input on this! |
Hopefully that's not a reflection on my post - I didn't mean to sound combative either. I've shared my input so will leave any further discussion to the maintainers. |
There are two problems with the following code:
del Delete the thing
(it does if there are noInput
widget).q Quit the app
enters the characterq
in the input widget, but doesn't quit the app.The text was updated successfully, but these errors were encountered: