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)
- priority binding order is not respected in the Footer HOT 6
- Method to add content to Content Switcher HOT 5
- Memray's test suite fails due to a deadlock with Textual 0.67.1 HOT 10
- Possible deadlock with the ToastRack and Tooltip that appeared out of nowhere HOT 3
- Clicking off the Select dropdown causes a crash in `update_focus` HOT 10
- v0.68.0 test_deadlock is failing HOT 12
- Some minor documentation additions HOT 3
- Add Image support using imgcat HOT 6
- Callback is not called when Screen is dismissed HOT 13
- `Tree.select_node` doesn't select the node, it highlights it HOT 5
- Using standard python logger HOT 3
- Documentation is not up-to-date HOT 3
- Travel back in time to 1900 HOT 2
- Crash opening and closing dialog really fast HOT 25
- On exit Texual always prints a lonely "<" to console HOT 3
- Workers report RUNNING state twice HOT 4
- Allow mouse-resizable Grid/Vertical/Horizontal with click-hold-drag-release type of resizing HOT 1
- Deadlock when closing app, associated with Footer.recompose and focus events HOT 5
- Right and bottom gets cut from keyline when using auto for width and height HOT 3
- MD links inside a MD table in Markdown Widget do not generate Markdown.LinkClicked when clicked HOT 2
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.