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

Home Page:https://kivymd.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MDTextField missing HelperText

ikus060 opened this issue · comments

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

  • OS: Linux
  • Python: v3.10.12
  • Kivy: v2.3.0
  • KivyMD: 2.0.1.dev0, git-4e9fdba, 2024-03-25

Thanks ! I will test it soon