-
Notifications
You must be signed in to change notification settings - Fork 815
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
Shouldn't be able to type in to a disabled input #2772
Comments
|
Can't reproduce with this app: class DisabledInput(App):
BINDINGS = [
Binding("ctrl+n", "disable_input", "Disable Input"),
]
def compose(self) -> ComposeResult:
yield Input("Disabled")
def action_disable_input(self) -> None:
self.query_one(Input).disabled = True
app = DisabledInput()
if __name__ == '__main__':
app.run() |
This does it: from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Input
class DisableFocus( App[ None ] ):
BINDINGS = [
( "ctrl+z", "disable" ),
]
def compose( self ) -> ComposeResult:
with Vertical():
yield Input()
def action_disable( self ) -> None:
self.query_one( Vertical ).disabled = not self.query_one( Vertical ).disabled
if __name__ == "__main__":
DisableFocus().run() |
davep
added a commit
to davep/textual-sandbox
that referenced
this issue
Jun 13, 2023
rodrigogiraoserrao
added a commit
that referenced
this issue
Jun 13, 2023
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
willmcgugan
pushed a commit
that referenced
this issue
Jun 14, 2023
* Add regression test for #2772. * Remove focus on nested disabled widgets. * Optimisation. Related comments: #2776 (comment) * Fix tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a widget is enabled and has focus, then subsequently disabled, you are still able to type.
When an input is disabled, it should ignore all interactions.
The text was updated successfully, but these errors were encountered: