Comments (5)
It's kinda tricky to see the difference between the two videos, but is the v0.51.0 one a little too eager to get to the new tab when using a mouse click? I suspect this is needed then:
diff --git a/src/textual/widgets/_tabs.py b/src/textual/widgets/_tabs.py
index 276f7e58..1948bb9c 100644
--- a/src/textual/widgets/_tabs.py
+++ b/src/textual/widgets/_tabs.py
@@ -644,7 +644,6 @@ class Tabs(Widget, can_focus=True):
self.query("#tabs-list Tab.-active").remove_class("-active")
tab.add_class("-active")
self.active = tab.id or ""
- self.query_one("#tabs-scroll").scroll_to_center(tab, force=True)
def _on_underline_clicked(self, event: Underline.Clicked) -> None:
"""The underline was clicked.
can you check and see if that removes what you're seeing?
from textual.
That doesn't appear to change anything.
from textual.
Curious. Now that I'm at a keyboard and can try and recreate all of this, with 0.51 (on the left in this video) I'm seeing an immediate jump (which is what I thought I was seeing in your video); if I make the change suggested above (make to Tabs._activate_tab
) I see the smoother scrolling I'd expect again:
Screen.Recording.2024-02-19.at.08.31.03.mov
I'll PR this change anyway so you can try again; perhaps the diff above (which I offered for illustrative purposes; of course it could be that your main
differed by the time you tried it out).
from textual.
Created #4178 for testing.
from textual.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
from textual.
Related Issues (20)
- A Widget with {margin: 1} style in a ScrollableContainer causes infinite resizes and scrollbars flicker HOT 7
- Pilot cannot click switch with horizontally aligned, long text HOT 5
- Clarify `is_end_of_document_line` in docs HOT 6
- Omitting TextArea theme doesn't highlight
- TabbedContent active attribute doesn't post message TabActivated + doesn't arrange tabs HOT 5
- TextArea crashes Python on html language HOT 5
- Blank display on AIX HOT 10
- check error in the "textual colors" app HOT 7
- Search Functionality for the Select Widget HOT 5
- No display on non-UTF8 locale HOT 1
- No Tcss file included in documentation for On_decorator example HOT 3
- Stop `TextArea` cursor moving beyond end of line in `read_only` mode? HOT 1
- Event documentation doubles up the bubble and verbose checkboxes HOT 3
- `grid-rows: auto` seems to be broken when `column-span`/`Pretty` is used HOT 5
- Dynamic bindings update HOT 1
- Problem with scrollable containers HOT 7
- SyntaxWarning for loading indicator widget HOT 3
- Potential bug with data bind HOT 6
- `TextArea` syntax highlighting for multi-language code HOT 2
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.