i can't move cursor by press up/down and left/right arrow #2475
-
Above code is data_table example, i find i can't move cursor by press up/down and left/right arrow, i don't know why? Could you help solve it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Are you sure the To make it so you don't have to press Tab first you could add the following to the end of your table.focus() |
Beta Was this translation helpful? Give feedback.
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 theDataTable
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: