iOS Slide open main sidebar from anywhere (#3859)
This commit is contained in:
parent
ff13f3e612
commit
2765d1b06b
1 changed files with 8 additions and 3 deletions
|
|
@ -417,7 +417,11 @@ export default class DrawerLayout extends Component {
|
|||
return true;
|
||||
}
|
||||
} else {
|
||||
if (moveX <= 35 && dx > 0) {
|
||||
const filter = Platform.select({
|
||||
ios: moveX > 0 && dx > 35,
|
||||
android: moveX <= 35 && dx > 0
|
||||
});
|
||||
if (filter) {
|
||||
this._isClosing = false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -449,8 +453,9 @@ export default class DrawerLayout extends Component {
|
|||
this._emitStateChanged(DRAGGING);
|
||||
};
|
||||
|
||||
_panResponderMove = (e: EventType, { moveX }: PanResponderEventType) => {
|
||||
let openValue = this._getOpenValueForX(moveX);
|
||||
_panResponderMove = (e: EventType, { moveX, dx }: PanResponderEventType) => {
|
||||
const useDx = Platform.OS === 'ios' && this.getDrawerPosition() === 'left';
|
||||
let openValue = this._getOpenValueForX(useDx ? dx : moveX);
|
||||
|
||||
if (this._isClosing) {
|
||||
openValue = 1 - (this._closingAnchorValue - openValue);
|
||||
|
|
|
|||
Loading…
Reference in a new issue