File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
7
7
8
+ ### Fixed
9
+
10
+ - Fixed ` OptionList ` causing excessive redrawing https://github.com/Textualize/textual/pull/5766
8
11
9
12
## [ 3.1.1] - 2025-04-22
10
13
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ class OptionList(ScrollView, can_focus=True):
165
165
}
166
166
& > .option-list--option-hover {
167
167
background: $block-hover-background;
168
- }
168
+ }
169
169
}
170
170
"""
171
171
@@ -784,8 +784,10 @@ def _update_lines(self) -> None:
784
784
)
785
785
786
786
last_divider = self .options and self .options [- 1 ]._divider
787
- self .virtual_size = Size (width , len (lines ) - (1 if last_divider else 0 ))
788
- self ._scroll_update (self .virtual_size )
787
+ virtual_size = Size (width , len (lines ) - (1 if last_divider else 0 ))
788
+ if virtual_size != self .virtual_size :
789
+ self .virtual_size = virtual_size
790
+ self ._scroll_update (virtual_size )
789
791
790
792
def get_content_width (self , container : Size , viewport : Size ) -> int :
791
793
"""Get maximum width of options."""
You can’t perform that action at this time.
0 commit comments