kivymd/KivyMD

MDTextField does not display all its components when included within a MDDialogContainer

bdenoun opened this issue · 1 comments

Description of the Bug

MDTextField does not display all its components when included within a MDDialogContainer. I managed to get the example code from the webpage to work (with icons and everything), but as shown in the screenshot, when including MDTextField, the icon and help text disappear. If I add the same text field in a standard BoxLayout, everything works fine though.

Code and Logs

from kivy.clock import Clock
from kivymd.app import MDApp
from kivymd.uix.dialog import (
    MDDialog,
    MDDialogHeadlineText,
    MDDialogSupportingText,
    MDDialogContentContainer,
)
from kivymd.uix.divider import MDDivider
from kivymd.uix.textfield import (
    MDTextField,
    MDTextFieldLeadingIcon,
    MDTextFieldHelperText,
)


class TestApp(MDApp):
    """Minimal Reproduction"""

    def on_start(self) -> None:
        """Method triggered when the app is starting"""
        Clock.schedule_once(self._pop_dialog, 1)

    def _pop_dialog(self, *args) -> None:
        """
        TODO
        """
        MDDialog(
            # -----------------------Headline text-------------------------
            MDDialogHeadlineText(
                text="Hello",
            ),
            # -----------------------Supporting text-----------------------
            MDDialogSupportingText(
                text="Blabla",
            ),
            # -----------------------Custom content------------------------
            MDDialogContentContainer(
                MDDivider(),
                MDTextField(
                    MDTextFieldLeadingIcon(
                        icon="account-question",
                    ),
                    MDTextFieldHelperText(text="Enter your ID"),
                    mode="outlined",
                ),
                MDDivider(),
                orientation="vertical",
            ),
        ).open()


if __name__ == "__main__":
    TestApp().run()

Screenshots

Screenshot 2024-06-26 at 08 17 32

Versions

  • OS: macOS Sonoma 14.5
  • Python: 3.12.0
  • Kivy: 2.3.0
  • KivyMD: 2.0.1.dev