Comments (3)
We found the following entry in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
This is an automated reply, generated by FAQtory
from textual.
Just to note in case it is relevant, there are also a couple of existing issues relating to column widths:
from textual.
I've had some time to look a bit into this. Still getting familiar with the Textual framework so apologies for any oversights here.
From what I'm seeing / intuiting
Flow of code
- Selector key is hit
self._set_hover_cursor(False)
is called fromaction_select_cursor
_data_table.py:2580. This ultimately queues a refresh of the current region- main.py handles the redraw, clearing the table and readding rows (including the newly added row)
- The refresh/render line from step 2 is called, the column width (set to the max required for all rows) has not yet been updated yet, so DataTable renders using the old column width. Important to note here that we get called to render the lines that existed previous to step 3 (in terms of indices)
_on_idle
_data_table.py:1706 is now called where we have need to update dimensions. in_update_dimensions
_data_table.py:1275 the column width is updated, additionally thevirtual_size
is updated to include the new row- Compositor now calls for the extra line that was just added to be rendered as well. The previous rows how however not updated in this cycle
Minor points to note
- if
self._set_hover_cursor
is not called in step one then the first render never happens and the entire table is re-rendered after the_on_idle
call i.e it works fine.- My gut feel on this is that we're triggering the whole "current region" to refresh by clearing and adding the rows, otherwise I would have /thought/ thiat
self._set_hover_cursor
would only cause the selected row to refresh
- My gut feel on this is that we're triggering the whole "current region" to refresh by clearing and adding the rows, otherwise I would have /thought/ thiat
- I'm not yet familiar with the purpose of
self._set_hover_cursor
- If I trigger
_on_idle
from theredraw
function (in a hacky way) it also works correctly as we've updated the column width before the render the first set of rows. Note that even if I do this still only the original set of rows and triggered to be rendered in the first cylce. - The reason other key bindings work to redraw is that they don't call
self._set_hover_cursor
/ don't cause that premature render
from textual.
Related Issues (20)
- Add feature: TCSS property font-size HOT 5
- Header Expansion HOT 6
- Color Palete HOT 1
- `pop_screen()` triggering randomly after hoovering buttons under heavy load HOT 13
- The type of dark attribute of class App might be inaccurate. (Reactive[bool] -> bool) HOT 5
- Broken Links in Reference/Widgets sections HOT 2
- Add tooltips to all input widgets HOT 1
- How to change text background on button click HOT 2
- CancelledError stack trace in terminal after quitting app with Ctrl+C HOT 2
- `on_leave` event being fired by widget in inactive screen
- pageup and pagedown bindings not firing on `main` branch HOT 6
- Memray's test suite deadlocks with Textual 0.65.2 HOT 3
- New default key bindings for DataTable override app-defined bindings HOT 3
- priority binding order is not respected in the Footer HOT 3
- Method to add content to Content Switcher HOT 3
- Memray's test suite fails due to a deadlock with Textual 0.67.1 HOT 7
- 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 8
- v0.68.0 test_deadlock is failing HOT 12
- Some minor documentation additions HOT 3
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.