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

cannot paste if backdrop is revealed #120

Open
lastmeta opened this issue Mar 11, 2022 · 6 comments
Open

cannot paste if backdrop is revealed #120

lastmeta opened this issue Mar 11, 2022 · 6 comments

Comments

@lastmeta
Copy link

lastmeta commented Mar 11, 2022

Describe the bug
I have an implementation where the backdrop is revealed, and takes up half the screen. I am unable to paste (by long holding and waiting for the paste popup). It does popup like normal, but clicking on the paste button does not preform the past task. Sometimes it seems like it clicks behind the paste button.

Possible Cause
So what I think is happening is that by pushing down the front layer the guesture detection for the paste popup gets pushed down too. This hypothesis is bolstered by the fact that I can reveal the backlayer by 1 pixel and still successfully click the paste button.

To Reproduce
Steps to reproduce the behavior:
Maybe this could be reproduced in other projects, I hope its not an artifact of the specific way I've implemented the Backdrop.

Screenshots
works fine when I disable the backdrop reveal
image
paste button just disappears on click when backdrop revealed
image

Smartphone (please complete the following information):

  • Device: pixel 3
  • OS: android
  • Browser emulator

Additional context
My particular implementation shouldn't cause this but if it matters, you'll see I instantiate the backdrop once and it remains persistent as the user navigates through the app (child being the page widget they are on)

...
class RavenMobileApp extends StatelessWidget {
  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorObservers: [components.navigator],
      initialRoute: '/',
      routes: ...
      ...
      builder: (context, child) {
        components.navigator.scaffoldContext = context;
        return BackdropScaffold(
          ...
          appBar: BackdropAppBar(...),
          backLayer: BackLayer(),
          frontLayer: Container(
            color: Colors.white,
            child: child!,        //  <--- front page navigation
          ),
        );
      },
    );
  }
...
@lastmeta
Copy link
Author

lastmeta commented Mar 11, 2022

actually it turns out paste works correctly up to but not including a backdrop layer height of 163. any height less than that, paste works just fine.

      Backdrop.of(components.navigator.routeContext!).revealBackLayer();
      return Container(height: 162.99); // works fine

So this is not due to my original hypothesis...

@daadu
Copy link
Member

daadu commented Mar 13, 2022

Interesting, will look into it. Meanwhile, if you find the solution - feel free to file a PR.

@lastmeta
Copy link
Author

lastmeta commented Mar 14, 2022

image

I'm struggling to figure out what the square box at the top is, but if the paste button is not within that square it does not paste.

Notice it is the same size as the white (front) area.

@lastmeta
Copy link
Author

lastmeta commented Mar 14, 2022

here's a better view
image
This area is as large as the white area. some kind of gesturedetection, idk. But it doesn't move down with the fling of the backdrop... and when the keyboard comes up it gets even smaller because it stays the same size as the white (front) area.

@lastmeta
Copy link
Author

it seems like that area is the raw gesture detection area associated with the paste button. it only shows up in the widget inspector when the paste widget tooltip is displayed.

@lastmeta
Copy link
Author

found a viable workaround for my usecase by disabling the toolbar altogether, but I should also note here that if we say
resizeToAvoidBottomInset=false on the scaffold it also works fine.

That tells me it's probably in the right spot, but the scaffold push up functionality pushes it up to it is as in the pictures, overlapping the backlayer rather than the front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants