Skip to content

Not sortable when props "order" defined #214

Open
@MikeCod

Description

@MikeCod

Hello,

I can't sort the list when I add the props "order". The bug is easily reproducible :

						<SortableList
							style={{}}
							contentContainerStyle={{padding:10}}
							scrollEnabled={false}
							data={this.state.questionnaire.questions.goals}
							sortingEnabled={true}
							order={this.state.goals_order}
							renderRow={({data, active}) => {
								return <Text style={{textAlign:'center'}}>{data}</Text>
							}}
							onChangeOrder={(nextOrder) => {
								this.setState({questionnaire:{
									...this.state.questionnaire, answers:{
										...this.state.questionnaire.answers, hobbies:{
											...this.state.questionnaire.answers.hobbies,
											[this.state.questionnaire.questions.hobbies_indoor.length*2+this.state.questionnaire.questions.hobbies_outdoor.length*2+2]: nextOrder.join('/')
								}}}});
							}}
						/>

Does anyone have a tips to solve this issue ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions