Giter Club home page Giter Club logo

react-native-modalbox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-modalbox's Issues

unable to use this great plugin

I'm facing an issue after I install this plugin, and then when I requiring it like this,

var Modal = require('react-native-modalbox');

It pops out the error message that "requiring unknown module "react-native-modalbox"

Ability to change the opening animation?

For a particular modal I am working with, I would like to be able to have the modal fade in from the center instead of coming up from bottom. What do you guys think?

Touchable* doesn't work on iPhone 6s

on iPhone 6s ,react-native-modalbox can't response Touch event,
even the third example(Position centered + backdrop + disable ) doesn't work.

I have check the index.js, I found that it is the Animated.View affect this.But I am not similar to the Animated.

related issue closed #10

Doesn't work on Android

I'm not sure if it's supposed to or not. It seemed from the comments on some commits that it should, but it doesn't work on Android.

Picker does not show inside Modal

Hello, first, Great Work with this component!,

A simple Picker is not showing inside Modal.

<Picker.Item label="0" value="0" />
<Picker.Item label="1" value="1" />

Possibility to have a default setup of the overlay (floating modal?)

Instead of closing the modal absolutely, is it possible to put the modal to have a default absolute positioned bottom value?

For eg:
Alt text

Here the more options may slide up the modal a little more to reveal more options between the button the the text.

Wondering if modalbox is the right option for something complex like this.

isOpen={true} does not work

Unfortunately isOpen={true} does not work as expected i.e. does not open directly and instead one has to click another time on the trigger element.

After install this and follow the steps to setup. Get these errors in Building App

/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:21:44: Cannot find protocol declaration for 'RCTViewNodeProtocol'
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:23:37: Cannot find protocol declaration for 'RCTViewNodeProtocol'
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:88:47: Cannot find protocol declaration for 'RCTViewNodeProtocol'
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:25:12: Property 'reactTag' not found on object of type '__strong id'
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:26:11: Cannot find protocol declaration for 'RCTViewNodeProtocol'
/Users/App/node_modules/react-native-modalbox/node_modules/react-native-overlay/RNOverlay.m:26:48: Property 'reactSubviews' not found on object of type '__strong id'

Can't scroll within' the modal

Maybe I am doing something wrong, but for some reason ScrollView is not working inside of a modal, and I can't adjust the height. For example when a form input is touched and I'd like to adjust the View height in relation to the keyboard.

Invariant Violation: Expected a component class, got undefined.

The screen-shots look excellent! I'm having a little trouble getting this off the ground, however. When using with RN 0.8.0, I am getting this exception whenever implementing the Modal:

Invariant Violation: Expected a component class, got undefined.

scroll from top to bottom auto close

I set scrollview inside smart modalbox, and when I scroll from top to bottom, modal auto close, I ensure that swipeToClose={false}, how could I fix it.

thanks for your time.

Dynamic children height

Hi, cool project. what if the height of children is dynamic. how to display them in the center with backdrop?

[Feature Request] Adding a swipeable area to dismiss the modal

Hi @maxs15, found your plugin to work just perfectly & very smoothly so I'm currently using it in my project.

Right now you can either enable or disable the swipe to dismiss feature. My problem is, my modal contains a scrollview, with much more content (ie. comments) than the modal hold.

I'm left with two solutions : Either I enable the swipe to dismiss, but then I'm unable to scroll inside my scrollView OR I disable the swipe to dismiss - which lead to a perfectly scrollable scrollview - but no ability to dismiss with a simple swipe down.

While looking for modals alternative, I found this : https://github.com/fomahaut/React-Native-Swipeable-Modal#readme

This modal is way less performant than this one but - as you can see - has a "swipeableAreaStyle" which allow the user to customize the are to be swiped.

What do you think?

Cheers

ability to disable fullscreen overlay

I'm not completely sure why the overlay is forced to the size of the entire screen, could this behaviour be modified so that the size is relative to the modals parent?

Modal is closed unexpectedly during state change

If content inside Modal changes state, modal box is closed and then cannot be re-opened. I've modified example so you could see this problem by clicking first modal and then "change text" button inside that modal.

'use strict';

var React   = require('react-native');
var Button  = require('react-native-button');
var Modal   = require('react-native-modalbox');

var {
  AppRegistry,
  StyleSheet,
    ScrollView,
  Text,
  View,
} = React;

var styles = StyleSheet.create({

  wrapper: {
    paddingTop: 50,
    flex: 1
  },

  modal: {
    justifyContent: 'center',
    alignItems: 'center'
  },

  modal1: {
    flex: 1
  },

  modal2: {
    height: 230,
    backgroundColor: "#3B5998"
  },

  modal3: {
    height: 300,
    width: 300
  },

  modal4: {
    height: 300
  },

  btn: {
    margin: 10,
    backgroundColor: "#3B5998",
    color: "white",
    padding: 10
  },

  btnModal: {
    position: "absolute",
    top: 0,
    right: 0,
    width: 50,
    height: 50,
    backgroundColor: "transparent"
  },

  text: {
    color: "black",
    fontSize: 22
  }

});

var Example = React.createClass({
  getInitialState(){
    return {text:"Initial text"};
  },

  openModal1: function(id) {
    this.refs.modal1.open();
  },

  closeModal1: function(id) {
    this.refs.modal1.close();
  },

  openModal2: function(id) {
    this.refs.modal2.open();
  },

  openModal3: function(id) {
    this.refs.modal3.open();
  },

  openModal4: function(id) {
    this.refs.modal4.open();
  },

  openModal5: function(id) {
    this.refs.modal5.open();
  },

  closeModal5: function(id) {
    this.refs.modal5.close();
  },

  onClose: function() {
    console.log('Modal just closed');
  },

  onOpen: function() {
    console.log('Modal just openned');
  },

  changeText: function() {
    this.setState({text:"Hello world!"});
  },

  onClosingState: function(state) {
    console.log('the open/close of the swipeToClose just changed');
  },

  render: function() {

    var BContent = <Button onPress={this.closeModal5} style={[styles.btn, styles.btnModal]}>X</Button>;

    return (
      <View style={styles.wrapper}>
        <Text>{this.state.text}</Text>
        <Button onPress={this.openModal1} style={styles.btn}>Basic modal</Button>
        <Button onPress={this.openModal2} style={styles.btn}>Position top</Button>
        <Button onPress={this.openModal3} style={styles.btn}>Position centered + backdrop</Button>
        <Button onPress={this.openModal4} style={styles.btn}>Position bottom + backdrop</Button>
        <Button onPress={this.openModal5} style={styles.btn}>Backdrop + backdropContent</Button>

        <Modal style={[styles.modal, styles.modal1]} ref={"modal1"} onClosed={this.onClose} onOpened={this.onOpen} onClosingState={this.onClosingState}>
          <Text style={styles.text}>Basic modal</Text>
          <Button onPress={this.changeText} style={styles.btn}>Change text</Button>
          <Button onPress={this.closeModal1} style={styles.btn}>Close modal</Button>
        </Modal>

        <Modal style={[styles.modal, styles.modal2]} backdrop={false}  position={"top"} ref={"modal2"}>
          <Text style={[styles.text, {color: "white"}]}>Modal on top</Text>
        </Modal>

        <Modal style={[styles.modal, styles.modal3]} position={"center"} ref={"modal3"}>
          <Text style={styles.text}>Modal centered</Text>
        </Modal>

        <Modal style={[styles.modal, styles.modal4]} position={"bottom"} ref={"modal4"}>
          <Button onPress={this.openModal1} style={styles.btn}>Basic modal</Button>
          <Text style={styles.text}>Modal on bottom with backdrop</Text>
        </Modal>

        <Modal style={[styles.modal, styles.modal4]} position={"center"} backdropContent={BContent} ref={"modal5"}>
          <Text style={styles.text}>Modal with backdrop content</Text>
        </Modal>
      </View>
    );
  }
});

AppRegistry.registerComponent('Example', () => Example);

RN 0.13.0-rc Errors? 'Cannot Read Property 'stop' of undefined

I'm experiencing a few errors on RN 0.13 (I came from v0.9 so cannot see when these were introduced)

Opening modals with content in still close immediately similar to #6. Also Sometime get 'Cannot Read Property 'stop' of undefined index.js:178.

Should this work on RN 0.13.0-rc? or am I getting ahead of myself?

First animate in doesnt run

When the modal is displayed for the first time between app load, the modal doesn't slide up. The background fade works fine, but not the slide in. Once the modal is closed, the animations then work fine, until the app is reloaded.

I tried to hack around this, by toggling on load, but i gave up and wrote an issue instead ๐Ÿ‘

Using React Native 0.19.0

Scroll View

ScrollView not working with listview inside modal even after specifying the swipeArea .
<Modal style={[styles.modal3]} position={"center"} ref={"modal3"} swipeToClose=
{this.state.swipeToClose} swipeArea={50}>

{this._renderTransactionList()}//RENDERING LISTVIEW

WebView on top of Modal

I'm trying to use this Modal, I have this configuration:

<View>
   <Modal
          isOpen={shareVisible}
          position={'center'}
          style={[styles.modal, styles.modal1]}>
          <View style={[styles.modalContainer, modalBackgroundStyle]}>
            <View style={[styles.innerContainer, innerContainerTransparentStyle]}>
              <TouchableHighlight
                onPress={() => this.setState({shareVisible: false})}>
                <Text>
                  Close
                </Text>
              </TouchableHighlight>
            </View>
          </View>
        </Modal>
        <WebView
          style={styles.webView}
          source={{uri: pdf.url}} />
</View>

The problem is that the WebView is on top of this Modal

InVisible the Modal

On click of one modal must open another modal; the first model must be closed while closing, it should not move down it should be invisible..

Move modal while open

Is there any way to move a modal without closing it? Changing the position does not seem to work. My use case is quite simple: I want to react to keyboard events by moving the modal, when the keyboard is opened, the module should move upwards by the height of the keyboard, and when the keyboard closes, the modal should move back to its original position.

TouchableHighlight onPress events do not work

Nice work on the modal! I'm on Android (emulator) and I was going to use the modal for buttons (like delete). TouchableHighlight's onPress does not work inside the modal it seems.

swipeToClose does not like to be changed

I'm working on a project that re-uses the same modal component with different behaviors (depending on content) for swipeToClose. However, swipeToClose (once set) does not play nicely with changes to this property.

From a quick dig through the code, it looks like the panResponder is created (or not) when the modal mounts and it's not setup to respond based on componentWillReceiveProps. But, it also looks like the pan responder that is created (in the case where swipeToClose={true}) is not destroyed when equal to false.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.