Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollable content does not respond to size changes, only when reopoening the portal overlay. #92

Closed
Elixell opened this issue Nov 3, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Elixell
Copy link

Elixell commented Nov 3, 2022

Describe the bug

Hi, thanks for the awesome work with Portal,.

I want to have a popup menu which responds to the window size changes, in my example a vertical size change should make the content scrollable if there is not enough space to render the children. My problem is that in the portal follower this doesn't happen despite the build clearly invoked. After reopening the portal the scrolling is fine.
I am not sure it is a bug or i am doing something wrong.
I attached a sample which shows the portal and the same list without the portal.

To Reproduce

 return Scaffold(
      body: Portal(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            PortalTarget(
              visible: isVisible,
              anchor: const Aligned(
                target: Alignment.bottomRight,
                follower: Alignment.topRight,
                widthFactor: 1.0
              ),
              portalFollower: Card(
                child: ListView(
                  children: List.generate(20, (index) => Container(
                    height: 30,
                    color: Colors.white,
                    child: const Text("Test"),
                  ))
                ),
              ),
              child: const Text("This is portal")
            ),
            SizedBox(
                width: 150,
                child: TextButton(
                  onPressed: () => setState(() {isVisible = !isVisible;}),
                  child: const Text("Show or hide the portal ")
                )
            ),
            Expanded(
              child: ListView(
                shrinkWrap: true,
                children: List.generate(20, (index) => Container(
                  height: 30,
                  color: Colors.white,
                  child: const Text("Test"),
                ))
              ),
            ),
          ],
        ),
      )
    );
portal_scroll.mp4
@Elixell Elixell added the bug Something isn't working label Nov 3, 2022
@fzyzcjy
Copy link
Owner

fzyzcjy commented Nov 3, 2022

Maybe related to #53?

@Elixell
Copy link
Author

Elixell commented Nov 3, 2022

Yes same issue, thanks for pointing out.

@Elixell Elixell closed this as completed Nov 3, 2022
@fzyzcjy
Copy link
Owner

fzyzcjy commented Nov 3, 2022

You are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants