Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

added maxDraggingOffset property #215

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bug fix
  • Loading branch information
Andrea Cresta committed Dec 8, 2016
commit 7e1b240fddca1a49e0f563b79e31b83cf826a9e1
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -217,9 +217,10 @@ class SideMenu extends React.Component {
onLayoutChange(e) {
const { width, height, } = e.nativeEvent.layout;
const openOffsetMenuPercentage = openMenuOffset * width;
const openMenuOffset = width * this.state.openOffsetMenuPercentage;
const openMenuOffset = this.props.openMenuOffset === undefined ? width * this.state.openOffsetMenuPercentage : this.props.openMenuOffset;
const hiddenMenuOffset = width * this.state.hiddenMenuOffsetPercentage;
this.setState({ width, height, openMenuOffset, hiddenMenuOffset });
this.setState({ width, height, openMenuOffset, hiddenMenuOffset, openOffsetMenuPercentage });

}

/**