-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Accordion does not fully close #137
Comments
Alright, I have narrowed down to this function in Collapsible, which is triggering and setting the height of the content to 20dp. The only component I have that has that height is some margins.
Edit: The problem is the height returned by the event.nativeEvent.layout.height. This is my renderContent stlye:
The nativeEvent.layout.height is saying that my content is 20 in height when is not fully collapsing, which is consistent with the padding. But it should't be adding that into the layout. I'll try playing with the margin and see what happens. |
Alright, making sure my content view (the wrapper for all the renderItem) does not have any margin or padding (AKA, moving the margin and padding to the children) made it collapse all the way. The issue right now is that it is collapsing visually but it is not setting the accordion section as collapsed so I have to double click in order to open that section again. Any workaround? |
Solved! The issue was that my content view, or wrapper for the renderContent had a flex style. I am not 100% sure why, but checking on the onLayout method of that content, it was saying that it had 0 height when I made an action or click inside that content. Replacing the flex: 1 for height: '100%' did the trick. Final style:
Weird issue. I am not closing this one yet since I think there are some other issues related to this and could be the same base problem. Feel free to close when ready. |
Glad to see that you resolved it @sfratini. I'll keep it open for a bit so others could see |
Maybe add it to the Wiki for future reference rather than keeping the issue open for a bit? Will also help out people in future once the issue has been closed. |
@pokkie Would you mind adding a page to the Wiki? |
@iRoachie added a page. bit lazy at the moment, but at least there is something there :) |
Looks good for now 🙂 |
I didn't get it. Can anybody explain me how can I solve it. I have one How Can I solve it @iRoachie ? |
@sfratini Hey, Is there a way to keep the accordian open even after the click event? I got a couple of click events in my accordian content and after a click event, the accordian seems to close up but according to my state, they are still active. |
@jenipharachel I dont remember the code, as I digged thought this like 2 years ago, but the Touchable in the accordion must be catching the touch before yours. I would add some console or debugging into the accordion code (it is all JS) and see what is triggering it. Or you could try to see what happens is you toggle and reset the prop from your parent. |
Hi! I am testing the Accordion with a series of Text, Buttons and Images in different configurations. For some reason, when I click on a button inside the accordion, it automatically tries to close the section but it does not fully does so, before actually following the action I have in a button.
I have tried putting a delay before the button does the action, in case the animation was cut short but is still the same issue. Any idea what could be happening?
My Accordion code:
There are some functions that I have because I have a "theme" system.
The text was updated successfully, but these errors were encountered: