sliding_up_panel icon indicating copy to clipboard operation
sliding_up_panel copied to clipboard

Click ExpandedPanel but triggers CollapsedPanel content

Open ShookLyngs opened this issue 3 years ago • 6 comments

Describe the bug

To trigger the bug when the panel was expanded:

In collapsed, we have a TextField. In panel, we have a Text.

When the panel is open, the content of collapse is hidden, but it's touchable. We can just click where the TextField were, and the soft keyboard will pop in. In this situation, if the content in panel is a Button instead of Text, the Button will be untouchable.

To trigger the bug in when the panel was collapsed:

We can also trigger the same bug on collapsed by replacing the content of panel, to a scrollable list. First, we open the panel. Then, we scroll the list of panel. Finally, we close the panel. now the content in collapsed is untouchable.

Code sample

Scaffold(
  appBar: AppBar(
    title: Text(widget.title),
  ),
  body: SlidingUpPanel(
    collapsed: Column(children: [
      TextField(),
    ]),
    panel: Center(
      child: Text("This is the sliding Widget"),
    ),
    body: Center(
      child: Text("This is the Widget behind the sliding panel"),
    ),
  ),
)

ShookLyngs avatar May 04 '21 08:05 ShookLyngs

I'm experiencing this same issue.

hannahlutd avatar Jul 07 '21 13:07 hannahlutd

I fixed this by wrapping my collapsed widget in a Visibility widget, and updating its visibility with: onPanelOpened: () => { setState(() { _collapsedVisible = false; }) }, onPanelClosed: () => { setState(() { _collapsedVisible = true; }) },

hannahlutd avatar Jul 07 '21 14:07 hannahlutd

I have the same issue from my application the collapsed widget is clickable, even if am on panel widget.

This is my collapsed widget: collapsed widget

This is my panel widget: panel widget

When am on panel widget, i can click over sign in or sign up widget. as it's invisible but touchable still.

MuhamadHaydar avatar Aug 06 '21 13:08 MuhamadHaydar

same issue

xang555 avatar Aug 28 '21 07:08 xang555

fixed I use Getx state management

  1. Wrap collapsed with IgnorePointer widget
  2. wrap panel with Visibility widget
  3. in controller
  void slidePanel(double value) {
    animateOpacity.value = value;

    // pannel visibility
    if (value == 0.0) {
      panelVisibility.value = false;
    } else {
      panelVisibility.value = true;
    }
}
  1. on onPanelSlide
 onPanelSlide: (position) {
              _homecontroler.slidePanel(position);
 },

work well for me

xang555 avatar Aug 28 '21 07:08 xang555