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
forcing the menu to re-calculate the percentage
  • Loading branch information
Andrea Cresta committed Dec 8, 2016
commit 72ecb993e8e1e15474940f3eaabfde74050d87b4
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -216,9 +216,11 @@ class SideMenu extends React.Component {

onLayoutChange(e) {
const { width, height, } = e.nativeEvent.layout;
const openMenuOffset = width * this.state.openOffsetMenuPercentage;

const openOffsetMenuPercentage = props.openMenuOffset / deviceScreen.width;
const openMenuOffset = width * openOffsetMenuPercentage;
const hiddenMenuOffset = width * this.state.hiddenMenuOffsetPercentage;
this.setState({ width, height, openMenuOffset, hiddenMenuOffset });
this.setState({ width, height, openMenuOffset, hiddenMenuOffset, openOffsetMenuPercentage });
}

/**