Giter Club home page Giter Club logo

Comments (5)

davep avatar davep commented on September 24, 2024

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.

willmcgugan avatar willmcgugan commented on September 24, 2024

That doesn't appear to change anything.

from textual.

davep avatar davep commented on September 24, 2024

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.

davep avatar davep commented on September 24, 2024

Created #4178 for testing.

from textual.

github-actions avatar github-actions commented on September 24, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

from textual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.