mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Set DataTable default style to max-height: 100% (#2974)
* Make the default max-height of a DataTable 100% See #2959 * Fix the demo Adding `max-height: 100%;` to DataTable has worked everywhere, except in the demo, where it makes the table just plain flat out disappear. It looks like it's down to a bug in Textual's CSS, possibly. This fixes the demo for now, and a standalone issue will follow that dives into what's going on with this particular combination of container and datatable styling. * Update the ChangeLog * Update the FAQ
This commit is contained in:
@@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Fixed issue with tabs in TextLog https://github.com/Textualize/textual/issues/3007
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Breaking change: the default style of a `DataTable` now has `max-height: 100%` https://github.com/Textualize/textual/issues/2959
|
||||
|
||||
## [0.30.0] - 2023-07-17
|
||||
|
||||
### Added
|
||||
|
||||
2
FAQ.md
2
FAQ.md
@@ -265,6 +265,8 @@ If scrolling in your `DataTable` is _apparently_ broken, it may be because your
|
||||
This means that the table will be sized to fit its rows without scrolling, which may cause the *container* (typically the screen) to scroll.
|
||||
If you would like the table itself to scroll, set the height to something other than `auto`, like `100%`.
|
||||
|
||||
**NOTE:** As of Textual v0.31.0 the `max-height` of a `DataTable` is set to `100%`, this will mean that the above is no longer the default experience.
|
||||
|
||||
<hr>
|
||||
|
||||
Generated by [FAQtory](https://github.com/willmcgugan/faqtory)
|
||||
|
||||
@@ -8,3 +8,5 @@ alt_titles:
|
||||
If scrolling in your `DataTable` is _apparently_ broken, it may be because your `DataTable` is using the default value of `height: auto`.
|
||||
This means that the table will be sized to fit its rows without scrolling, which may cause the *container* (typically the screen) to scroll.
|
||||
If you would like the table itself to scroll, set the height to something other than `auto`, like `100%`.
|
||||
|
||||
**NOTE:** As of Textual v0.31.0 the `max-height` of a `DataTable` is set to `100%`, this will mean that the above is no longer the default experience.
|
||||
|
||||
@@ -208,6 +208,7 @@ LocationLink:hover {
|
||||
|
||||
DataTable {
|
||||
height: 16;
|
||||
max-height: 16;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
background: $surface ;
|
||||
color: $text;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
DataTable > .datatable--header {
|
||||
text-style: bold;
|
||||
|
||||
Reference in New Issue
Block a user