Comments (7)
貌似解决了. 改了源码.😂
from react-native-drag-sort.
大分类和大分类相互拖动、同一个大分类里小分类相互拖动 应该可以。但是不同大分类内里的小分类拖动不行
from react-native-drag-sort.
@mochixuan 这样就行.我试试. AnySizeDragSortableView 有没有和 SectionList的滚动冲突的解决方案? 我看了demo, 只写了DragSortableView的样例.
from react-native-drag-sort.
里面是有滚动适配的,你可以看下里面的代码
from react-native-drag-sort.
我看了滚动适配的demo, 是和ScrollView嵌套的. 我用AnySizeDragSortableView里嵌套DragSortableView来实现. 但AnySizeDragSortableView 这个组件没有对外暴露 是否控制它滚动的props.
from react-native-drag-sort.
表情解决了。改了源。😂
是否可以放出改了哪里 参考下 有个需求和你差不多
from react-native-drag-sort.
AnySizeDragSortableView 中修改源码, 如果是小分类拖动,就让大分类的scrollEnabled为false.
render() {
const {selectedItem, selectedPosition, scrollEnabled} = this.state
const {dataSource, keyExtractor, renderItem, movedWrapStyle, scrollEnabled: scroll} = this.props
const scrollState = scroll === false ? scroll : scrollEnabled
return (
<View style={styles.box}>
{
selectedPosition && (
<View style={[movedWrapStyle, { left: selectedPosition.left, top: selectedPosition.top, position: 'absolute', zIndex: 999 }]}>
{renderItem(selectedItem, null, true)}
</View>
)
}
<ScrollView
bounces={false}
scrollEventThrottle={1}
scrollIndicatorInsets={this.props.scrollIndicatorInsets}
ref={(scrollRef)=> {
if (this.props.onScrollRef) this.props.onScrollRef(scrollRef)
this.scrollRef = scrollRef
return this.scrollRef
}}
scrollEnabled = {scrollState}
onScroll={this.onScrollListener}
style={styles.scroll}>
{this.props.renderHeaderView ? this.props.renderHeaderView : null}
<View style={styles.container}>
{
dataSource.map((item, index) => {
const key = keyExtractor(item, index)
this.keyToIndexMap.set(key, index)
return (
<View
key={key}
{...this._panResponder.panHandlers}
onLayout={event => this._setLayoutData(key, event)}
>
{renderItem(item, index, false)}
</View>
)
})
}
</View>
{this.props.renderBottomView ? this.props.renderBottomView : null}
</ScrollView>
</View>
)
}
scrollState 是我修改源码的部分.
@JonsonHI
from react-native-drag-sort.
Related Issues (20)
- 可以支持一下分组吗 HOT 1
- 长按后,放大后,在复原是什么原因?导致不能拖动.
- 还是有bug. HOT 1
- onClickItem 事件,点击希望有点击效果的处理 HOT 1
- 点击item局部触发可拖动行为
- How to do this like bumble app HOT 1
- Add support for passing scrollEnabled prop
- gesture conflict
- 能支持拖拽分组吗?类似手机桌面图标拖拽效果 HOT 1
- AnySizeDragSortableView中嵌套 AutoDragSortableView 实现商品1.2级分类遇到的bug、请作者帮忙看看
- 兼容性问题.和 [email protected]不兼容.报错
- 为什么一定要按住文字才能拖动? 按住View中的图标组件,无法拖动
- 频繁的拖动后,报错TypeError: Cannot read properties of null (reading 'ref') HOT 1
- AnySizeDragSortableView not rendering anything HOT 3
- Q: Multiple AutoDragSortableView
- react-navigation由于版本太低 无法在最近的rn版本运行
- 如何支持分类之间拖动 HOT 1
- AutoDragSortableView只有这个用不了 别的都能用
- this4.touchCurItem.ref.setNativeProps is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-drag-sort.