rio-labs / rio

WebApps in pure Python. No JavaScript, HTML and CSS needed
https://rio.dev
Apache License 2.0
600 stars 25 forks source link

[BUG]: IconButton in Popup shrinks to zero size if popup is not open by default #134

Open Julien-Schneider opened 2 weeks ago

Julien-Schneider commented 2 weeks ago

Describe the bug

If there is an IconButton within the content of a popup, it will shrink to 0 though space in the popup container is reserved for the IconButton.

If however the Popup is open by default the IconButton will show as expected.

Steps to Reproduce

Minimal Example:

class Test(rio.Component):
    _open: bool = False

    def build(self) -> rio.Component:
        anchor = rio.IconButton("rocket", align_x=0.5, on_press=self.toggle_open)
        content = rio.Column(
            rio.Text("Text and Icon works"),
            rio.Icon("check_small"),
            rio.IconButton("error")
        )

        return rio.Popup(anchor=anchor, content=content, is_open=self._open, position="bottom")

    def toggle_open(self):
        self._open = not self._open

Screenshots/Videos

grafik

Operating System

Windows

What browsers are you seeing the problem on?

Firefox, Edge

Browser version

No response

What device are you using?

Desktop

Additional context

No response

mad-moo commented 2 weeks ago

Thank you for reporting! I can reproduce this and we're looking into it