Comments (2)
Here's a quick MRE, tested against Textual v0.63.5. If you ensure the first widget is definitely focused by clicking on the first FooWidget
with the mouse, tabbing through the widgets then seems to update the Footer
as expected.
Without this initial mouse click, the Footer
seems to only update after every second press of Tab. I suspect this is related to a similar issue I posted in this discussion?
from textual.app import App, ComposeResult
from textual.widget import Widget
from textual.widgets import Footer
class TestWidget(Widget, can_focus=True):
DEFAULT_CSS = """
TestWidget {
border: tall $background;
height: 1fr;
}
TestWidget:focus {
border: tall $accent;
}
"""
class FooWidget(TestWidget, can_focus=True):
BINDINGS = [("f", "app.bell", "Foo")]
class BarWidget(TestWidget, can_focus=True):
BINDINGS = [("b", "app.bell", "Bar")]
class BazWidget(TestWidget, can_focus=True):
BINDINGS = [("z", "app.bell", "Baz")]
class BindingsApp(App):
def compose(self) -> ComposeResult:
yield FooWidget()
yield BarWidget()
yield BazWidget()
yield Footer()
if __name__ == "__main__":
app = BindingsApp()
app.run()
from textual.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
from textual.
Related Issues (20)
- Serving files HOT 1
- Documentation errors on CSS Type Selectors HOT 6
- Updating a label with text containing square brackets hides those brackets and the word behind it HOT 4
- v0.75.0 has massive slowdown HOT 5
- ProgressBar: decrease CPU consumption by adjusting Bar.auto_refresh when styles.display is None HOT 3
- Upgrade Textual's tree-sitter version to 0.22.x HOT 7
- `TextArea` scrollbar position is not updated after paste HOT 2
- Command palette glitch HOT 5
- Command palette cancel HOT 3
- Change command palette key HOT 5
- Watch Highlander for the first time HOT 5
- Make tooltip timer confugrable HOT 2
- Pytest gets stuck when testing app with dynamically mounting animated widgets on timer HOT 5
- v0.76.0 breaks buttons with emojis HOT 7
- self test problems HOT 6
- Investigate flaky `test_command_palette_dismiss_escape_no_results` snapshot test HOT 3
- Inline mode doesn't show CSS errors HOT 3
- Extraneous padding when using inline mode HOT 7
- InvalidStateError when dismissing Screen HOT 6
- Mouse enter in a child widget triggers Leave event in parent HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textual.