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

Optionally disable command palette key #5321

Closed
willmcgugan opened this issue Dec 2, 2024 Discussed in #5316 · 1 comment · Fixed by #5322
Closed

Optionally disable command palette key #5321

willmcgugan opened this issue Dec 2, 2024 Discussed in #5316 · 1 comment · Fixed by #5322

Comments

@willmcgugan
Copy link
Collaborator

Discussed in #5316

Originally posted by and-viceversa December 1, 2024
How can I temporarily disable the command palette and its binding?

My application makes use of the command palette but there are times when it'd be nice to temporarily disable it as well.

For example, there might be a temporary Screen with a "Yes/No/Cancel" type option flow. If the command palette is accessible, the user can pivot away from that screen without choosing an available option.

Reading through the App source, the command palette is pretty tightly coupled to the App itself. ENABLE_COMMAND_PALETTE is typed as a ClassVar so I can't modify that from within my App instance.

Another possible method is to disable the command palette at the application level, and then reimplement the Binding for each Screen. That seems like either I've missed something simple or too hacky an approach.

Copy link

github-actions bot commented Dec 3, 2024

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

Successfully merging a pull request may close this issue.

1 participant