kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.14k stars 655 forks source link

False Tab content in tab bar #1664

Open RobertFlatt opened 3 months ago

RobertFlatt commented 3 months ago

Description of the Bug

Tab contents can be rendered in the tab bar, these are false images of widgets, not active widgets.

Scroll down to Button 9. Move cursor fast up to Button 6. Issue: look at false button image(s) above in Tab bar

Code and Logs

from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView

from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.boxlayout import MDBoxLayout
from kivymd.uix.button import MDButton, MDButtonText
from kivymd.uix.tab import (
    MDTabsItemIcon,
    MDTabsItemText,
    MDTabsItem,
)

KV = '''
MDScreen:
    md_bg_color: self.theme_cls.backgroundColor
    MDBoxLayout:
        orientation:'vertical'
        MDTabsPrimary:
            id: tabs
            pos_hint: {"center_x": .5, "center_y": .5}
            MDDivider:
            MDTabsCarousel:
                id: related_content_container
                size_hint_y: None
                height: dp(320)
        MDLabel:
            text:'Scroll down to Button 9. Move cursor fast up to Button 6. \\nIssue: look at false button image(s) above in Tab bar.'
            halign:'center'
'''

class Example(MDApp):
    def on_start(self):
        super().on_start()
        self.root.ids.tabs.add_widget(
            MDTabsItem(MDTabsItemText(text='A Tab')))

        bl = MDBoxLayout(orientation='vertical',
                         size_hint_y=None)
        bl.bind(minimum_height=bl.setter('height'))
        for i in range(10):
            bl.add_widget(MDButton(MDButtonText(text='Button '+str(i)),
                                   pos_hint={"center_x": .5, "center_y": .5}))

        sv = ScrollView()
        sv.add_widget(bl)
        self.root.ids.related_content_container.add_widget(sv)

    def build(self):
        self.theme_cls.primary_palette = "Olive"
        return Builder.load_string(KV)

Example().run()

Screenshots

False images disappear on certain refresh events, hence photo not screenshot. The line below Button 1 is the MDDivider between tabs contents and header.

issue3

Versions

HeaTTheatR commented 2 months ago

https://github.com/kivymd/KivyMD/issues/1635