akshathjain / sliding_up_panel

A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
https://pub.dartlang.org/packages/sliding_up_panel
Other
1.36k stars 379 forks source link

Click ExpandedPanel but triggers CollapsedPanel content #245

Open ShookLyngs opened 3 years ago

ShookLyngs commented 3 years ago

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"),
    ),
  ),
)
hannahlutd commented 3 years ago

I'm experiencing this same issue.

hannahlutd commented 3 years ago

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; }) },

MuhamadHaydar commented 3 years ago

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.

xang555 commented 3 years ago

same issue

xang555 commented 3 years ago

fixed I use Getx state management

  1. Wrap collapsed withIgnorePointer 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;
    }
    }
  4. on onPanelSlide
    onPanelSlide: (position) {
              _homecontroler.slidePanel(position);
    },

work well for me

sunilsinghchaudhary00 commented 1 month ago

fixed I use Getx state management

  1. Wrap collapsed withIgnorePointer 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

thanks without ignore pointer working fine open panel using tap and closed it using X icon thanks