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

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

Closed bdenoun closed 3 days ago

bdenoun commented 3 days ago

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

HeaTTheatR commented 3 days ago

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