Skip to content
Discussion options

You must be logged in to vote

Are you sure the DataTable had focus? By default, when a Textual application starts up, no widget will have focus, and so in this case the DataTable won't receive keyboard input. If you were to press Tab first and then use the cursor keys you should find that it works (testing here that's exactly what I see with your code above).

To make it so you don't have to press Tab first you could add the following to the end of your on_mount method:

table.focus()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zhajio1988
Comment options

@davep
Comment options

Answer selected by zhajio1988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2474 on May 04, 2023 07:35.