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

Scrolling issue #12

Open
nishantpardamwar opened this issue Jun 5, 2017 · 27 comments
Open

Scrolling issue #12

nishantpardamwar opened this issue Jun 5, 2017 · 27 comments
Assignees

Comments

@nishantpardamwar
Copy link

sorry for opening another issue :D
so the issue is if MultiSelect component is inside a scrollview then ItemSelection windows scroll doesnt work and if i remove the scrollview then if selected items are taking more space than available screen then there is not way to see all the selected items as selected item windows itself is not scrollable

@mitesh-mutha
Copy link

Hi, I face a similar issue.

@nishantpardamwar did you find a solution for this?

@toystars
Copy link
Owner

toystars commented Sep 25, 2017

@nishantpardamwar @mitesh-mutha sorry for the late response. I just updated the component with a new prop fixedHeight which tells the select list to take a fixed height or take the height of all the children in the list. The prop defaults to false, so having the component in a scrollview will push all following components downward in the view so you have access to all items in the list. Setting the prop to true will give a fixed height and should only be used in a view without a need to scroll.

@mitesh-mutha
Copy link

Hi, @toystars. Thank you for your response.
Having tested your update. I find that with fixedHeight as false, the submit button disappears at times. It usually (though not always, and also, not limited to) happens when I have already selected few items, then remove some item(s) and then want to select again. At this point, the submit button is not seen.
Let me know if I can provide any additional info for the same.
Can you help me out with this?

@toystars
Copy link
Owner

@mitesh-mutha can you post your code snippet? So I can try to reproduce... I might be able to catch the reasons for the issue.

@priyanga2496
Copy link

Hi, I dont see the full list, because its not fixing within the container

@priyanga2496
Copy link

How to make the list fix within the container height in multiple select @toystars

@abdulmoizlakhani
Copy link

abdulmoizlakhani commented Oct 19, 2018

I also had the same issue. I wanted to give a certain height to multiple select list and also wanted to make it scrollable. Firstly I searched for the solution but did not get the satisfactory solution. At last I tried by giving the height to the View on line 445 of this module. And the result was I got the desired height and also the list was scrollable if the number if list item exceeds to height. But I know that this is not the proper solution. I would suggest the contributors to add the styles prop for the View on line 445 like
<MultiSelect listContainerStyles={styles} />

Thanks.

@AugustoAleGon AugustoAleGon self-assigned this Jan 28, 2019
@AugustoAleGon
Copy link
Collaborator

@Abdul-Moiz-Lakhani Can you point me the line on the current code? It has a changed a lot... Thanks in advance.

@abdulmoizlakhani
Copy link

abdulmoizlakhani commented Jan 28, 2019

@AugustoAleGon

I just installed the package again and found that View on the same line # 445.
Here is that View:

if (canAddItems && !searchTermMatch && searchTerm.length) {
      addItemRow = this._getRowNew({ name: searchTerm });
    }
    component = (
      **_<View>
        {itemList}
        {addItemRow}
      </View>_**
    );
    return component;
  };

@AugustoAleGon
Copy link
Collaborator

The package is not updated. I am not able to upload. Try to remove first and apply yarn add https://github.com/toystars/react-native-multiple-select.git

@AugustoAleGon
Copy link
Collaborator

so That line is the one that you change and you don't need the fixedHeight property right? @Abdul-Moiz-Lakhani

@abdulmoizlakhani
Copy link

Yes, just provided the desired height by inline css to that View.

@AugustoAleGon
Copy link
Collaborator

Awesome. Let me upload that change for closing this issue. @Abdul-Moiz-Lakhani . Appreciate your help and quick response.

@abdulmoizlakhani
Copy link

@AugustoAleGon

It's now on line #465.

@AugustoAleGon
Copy link
Collaborator

@Abdul-Moiz-Lakhani Request completed...

@ayushagarwalk
Copy link

@abdulmoizlakhani Sir, even im facing the issue.. please help all of solve it asap

@AbdulmalickDimnang
Copy link

this behavior only happens on Android it seems... but iOS works like a charm

@michelegoh
Copy link

michelegoh commented Mar 6, 2020

I managed to get it working by adding nestedScrollEnabled={true} to the parent ScrollView and flatListProps={{nestedScrollEnabled: true}} to the MultiSelect as per this stack overflow answer

@irfanandratama
Copy link

Mine still can't scroll even after set nestedScrollEnabled on scrollview and flatlistprops. Can anyone help?

@AugustoAleGon
Copy link
Collaborator

@irfanandratama can you provide any extra information? npx react-native info would be fine.

Is the multiselector inside a listview?

@FrankieJLyons
Copy link

Any update on this? I can not get the drop down to scroll after trying all solutions here.

I have it inside a container of a normal view, flex set to 0 allows for all the items to be clicked - having flex set to a value stops anything in the drop down that goes past the flex box to become unclickable

@FrankieJLyons
Copy link

Scratch that: without changing anything to the actual module, I added this line:

styleListContainer={{height: 256}}

While the module is inside a normal view with a flex of 1. The drop down now has a fixed height, and I can scroll within it

@YunusEmreNalbant
Copy link

Scratch that: without changing anything to the actual module, I added this line:

styleListContainer={{height: 256}}

While the module is inside a normal view with a flex of 1. The drop down now has a fixed height, and I can scroll within it

is working. thanks

@viz21
Copy link

viz21 commented Oct 5, 2021

Scratch that: without changing anything to the actual module, I added this line:

styleListContainer={{height: 256}}

While the module is inside a normal view with a flex of 1. The drop down now has a fixed height, and I can scroll within it

Works for me as well. Replace height with maxHeight so the list won't be the same height when there are not many items in it

@dj-wedig
Copy link

Nothing above worked for me...

Following was my use case: I had a form inside Scrollview. And this multi-select picker was one of the component. The list inside picker was scrolling only when I disable my form's scrollview. I, then found this work around.

Commenting "Scrollview" tag in MultiSelectPicker.tsx worked

Screenshot 2022-05-26 at 12 15 50 PM

Flatlist, itself, has scrolling feature why to put it inside scrollview.

@rajusiripalli
Copy link

styleListContainer={{height: 256}}

thanks bro it's working fine

@z0penc0
Copy link

z0penc0 commented Feb 7, 2023

Hi guys, I'm having same scroll issues but just with the multiSelect inside an empty screen in a stackNavigator. If using just flex: 1 inside container view the list shows and scrolls, filling up the full height. If I add the fixedHeight=true property, then height of the scroll list is to about half the screen height and scrolling starts to have issues. It looks like the top %60 of the list responds well to dragging gestures, but the bottom %40 does not.

edit: @FrankieJLyons solution worked, thanks!

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