react-native-modalbox icon indicating copy to clipboard operation
react-native-modalbox copied to clipboard

unable open the modal from right or left

Open cindyya opened this issue 5 years ago • 4 comments

cindyya avatar Mar 01 '19 01:03 cindyya

I also want this feature.

prodoxx avatar Mar 06 '19 22:03 prodoxx

Check line 448 in index.js for this project. Change to something like this:

style={[styles.wrapper, size, this.props.style, {transform: [{translateY: this.props.sideOpening == 'horizontal' ? offsetX : this.state.position}, {translateX: this.props.sideOpening == 'horizontal' ? this.state.position : offsetX}]} ]}

and around line 246 change this:

let positionDest = this.calculateModalPosition(this.state.containerHeight - this.state.keyboardOffset, this.state.containerWidth);

to this:

let positionDest = this.calculateModalPosition(this.state.containerWidth, this.state.containerHeight);

I added props called sideOpening so when it's horizontal it opens from the right to left and when it's vertical it opens from bottom to top. It's just a quick fix. Works for my current project.

Cheers.

prodoxx avatar Mar 06 '19 23:03 prodoxx

I have the same issue did you solve it? @cindyya

fouad1994 avatar Mar 10 '19 07:03 fouad1994

this.calculateModalPosition(this.state.containerWidth, this.state.containerHeight);

Very nice work @prodoxx !

I used your description to make a version that work from left to right with other parts of his lib working like pan gestures and animations.

I used the prop entry with the value 'left' instead of creating a new one.

https://github.com/AugustusCosta/react-native-modalbox

AugustusCosta avatar Jun 05 '19 01:06 AugustusCosta