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.25k stars 674 forks source link

MDTextField missing HelperText #1712

Closed ikus060 closed 5 months ago

ikus060 commented 5 months ago

Description of the Bug

When creating MDTextField on the fly. The HelperText is not displayed.

Code and Logs

from kivy.clock import Clock
from kivy.lang import Builder

from kivymd.app import MDApp
from kivymd.uix.boxlayout import MDBoxLayout

KV = """
MDScreen:
    md_bg_color: self.theme_cls.backgroundColor

    MDBoxLayout:
        id: wrapper

        Component:

    MDBoxLayout:

        MDButton:
            on_release: app.add()

            MDButtonText:
                text: "Add"

<Component>:

    MDTextField:
        id: field
        pos_hint: {"center_x": .5, "center_y": .5}
        text: "Text"
        size_hint_x: .6
        name: "Hint text"

        MDTextFieldHelperText:
            text: "Helper text"
            mode: "persistent"

"""

class Component(MDBoxLayout):
    pass

class TestHelperTextModePersistent(MDApp):
    def build(self):
        return Builder.load_string(KV)

    def add(self):
        subview = Component()
        self.root.ids.wrapper.add_widget(subview)

TestHelperTextModePersistent().run()

Screenshots

Initial MDTextField has a helpertext. image

But when adding new widget, the new one doesn't have helper text. image

Versions

HeaTTheatR commented 5 months ago

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

ikus060 commented 5 months ago

Thanks ! I will test it soon