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

Tap on body of ExpandablePanel does not expand the widget when it is collapsed. #41

Closed
bambinoua opened this issue Jan 8, 2020 · 4 comments

Comments

@bambinoua
Copy link

bambinoua commented Jan 8, 2020

Tap on body of ExpandablePanel does not expand the widget when it is collapsed. Tap on body of ExpandablePanel collapse the widget when it is expanded. In version 3.0.1 tap on body behavour was the same as tap on icon behavour. Is it possible to fix this?

@aryzhov
Copy link
Owner

aryzhov commented Jan 10, 2020

I will take a look, thank you.

@Viper-Bit
Copy link

Viper-Bit commented Jan 13, 2020

@aryzhov i think it comes from line 458

        return builder(context, collapsed, buildBody(expanded));

and line 461

          collapsed: collapsed,

maybe u missed buildBody for collapsed object, i can make a pull if u will

return builder(context, collapsed, buildBody(expanded));

collapsed: collapsed,

@aryzhov
Copy link
Owner

aryzhov commented Jan 15, 2020

The current behavior is by design. The parameter tapBodyToCollapse works only for collapsing, not for expanding. ExpandablePanel has an icon that is supposed to be used for expansion. Optionally, you may use tapHeaderToExpand to extend the expansion trigger to the header. Extending this to the body would not yield better usability as the user would not know that clicking on the body would expand it. In addition, if your collapsed body is long enough, it might impact scrolling where the user accidentally expands the body by clicking on it.

The reason tapBodyOnCollapse exists is for cases when the expanded body occupies the entire screen and there's no desire to add a button that collapses it.

If you still wish to implement this behavior, simply wrap your expanded body into ExpandableButton.

@aryzhov aryzhov closed this as completed Jan 15, 2020
This was referenced Jan 15, 2020
@aryzhov
Copy link
Owner

aryzhov commented Jan 22, 2020

I added this feature to version 4.1.0 that has been released. You can specify tabBodyToExpand: true in the theme.

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

3 participants