Giter VIP home page Giter VIP logo

react-bootstrap-modal's Introduction

React Bootstrap Modal

Partly a port of jschr's bootstrap modal. Reimplements the Twitter Bootstrap Modal component in a React friendly way. Based on the original work of the react-bootstrap team.

note: React bootstrap modal is compatible with bootstrap 3.3.4+ if you want to use it with an earlier version of bootstrap 3 you need to override the .modal-backdrop styles to be the most recent one.

Features

  • Scoped focus
  • Stackable! (use with constraint)
  • Animated feedback when trying to close a "static" Modal
  • Straightforward API, no ModalTrigger or Overlay mixins to deal with

Use

var Modal = require('react-bootstrap-modal')

class ModalExample extends React.Component {

  render(){
    let closeModal = () => this.setState({ open: false })

    let saveAndClose = () => {
      api.saveData()
        .then(() => this.setState({ open: false }))
    }

    return (
      <div>
        <button type='button'>Launch modal</button>

        <Modal
          show={this.state.open}
          onHide={closeModal}
          aria-labelledby="ModalHeader"
        >
          <Modal.Header closeButton>
            <Modal.Title id='ModalHeader'>A Title Goes here</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <p>Some Content here</p>
          </Modal.Body>
          <Modal.Footer>
            // If you don't have anything fancy to do you can use
            // the convenient `Dismiss` component, it will
            // trigger `onHide` when clicked
            <Modal.Dismiss className='btn btn-default'>Cancel</Modal.Dismiss>

            // Or you can create your own dismiss buttons
            <button className='btn btn-primary' onClick={saveAndClose}>
              Save
            </button>
          </Modal.Footer>
        </Modal>
      </div>
    )
  }
}

ReactDOM.render(<ModalExample />, document.body);

Styles

If you are already including Twitter Bootstrap styles (e.g. bootstrap.min.css), then include /lib/css/rbm-patch.css. If you want to use this module without Twitter Bootstrap, then include /lib/css/rbm-complete.css.

If you do not like the Bootstrap visual look and feel, you can adjust variables.less to suit your needs and transpile it to css yourself.

Components

Modal

The main Modal Component.

Props

  • show: Boolean(default false) make the Modal visible or hidden

  • backdrop: Enum<'static', true, false>(default true) - Should the modal render a backdrop overlay. "static" backdrops are not dismissible by clicking the backdrop.

  • keyboard: Boolean(default true) Modal is dismissible via the esc key

  • transition Boolean(default true) Fade the entry and exit of the modal. You can also provide a Transition component from the react-transition-group v2 library to customize the animation more minutely.

  • attentionClass: String(default 'shake') - an animation class added to the modal when a "static" backdrop is clicked, set to nothing if no animation is desired

  • container: Node(default document.body), a DOM Node to append the modal too

  • onEnter: handler fires right before the Modal animates in

  • onEntering: handler fires as the Modal starts entering

  • onEntered: handler fires after the enter animation finishes

  • onExit: handler fires right before the Modal animates out

  • onExiting: handler fires as the Modal starts exiting

  • onExited: handler fires after the exit animation finishes

Modal.Header

The Header section of Modal. If not included be sure to add an aria-labelledby elsewhere to keep the Modal accessible.

Props

  • closeButton: Boolean(default true) - render a close button or not
  • onClose: Function() - a Handle when the close button is clicked. if left undefined the Header will automatically wire itself into the parent Modal onHide(), so you only need to specify a handler if you want a different behavior

Modal.Title

Modal.Body

The main content of the Modal, a convenience Component for: <div className='modal-body'>content</div>

Modal.Footer

The bottom footer of the Modal, a convenience Component for: <div className='modal-footer'>content</div>

Modal.Dismiss

A dismiss button for the Parent Modal. Dismiss button will trigger its parent Modal onHide() handler. You don't need to use a Dismiss button, they are just a Convenience Component.

Modal.BaseModal

BaseModal represents just the modal markup without any of the logic to render it to the document.body. It is generally not recommended that you work with this component directly. You can use it if you really want to render a Modal inline.

react-bootstrap-modal's People

Contributors

atis-- avatar jennifer-shehane avatar jesenko avatar jquense avatar kamilmielnikcodete avatar penguinpowernz avatar pisi-deff avatar plag avatar playpauseandstop avatar semantic-release-bot avatar vkbansal avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-bootstrap-modal's Issues

Is it possible to have the modal appear beside the clicked button?

Hi,

I was wondering if it's possible to have the modal appear beside the clicked button without the background being out of focus?

Right now, this is what my page looks like and I'd like to have a small modal appear beside the clicked node on the tree but it covers the middle of the screen and makes the background out of focus.

Uploading Screen Shot 2019-07-26 at 3.45.52 PM.png…
Screen Shot 2019-07-26 at 3 45 54 PM

example doesn't work.

your example code doesn't link to bootstrap css.
the standard bootstrap modal styling has a default for display:none; which needs to be overwritten using:

.modal{ display:block; }

The button doesnt have a click handler
and the state.open isn't set in render it should be instantiated before that
it there is a warning if rendering to the document.body - it is preferred to render to tag, eg

import React from 'react';
import {render} from 'react-dom';
import "../../styling/main.scss";
var Modal = require('react-bootstrap-modal');
 
class App extends React.Component {
	constructor(props)
	{
		super(props);
		this.state={open:false};
		this.handleClick = this.handleClick.bind(this);
	}
 	handleClick()
 	{
 		this.setState({open:true});
 	}
 	render(){
    let closeModal = () => this.setState({ open: false })
 
    let saveAndClose = () => {
      api.saveData()
        .then(() => this.setState({ open: false }))
    }
 
    return (
      <div>
        <button type='button' onClick={this.handleClick}>Launch modal</button>
 
        <Modal
          show={this.state.open}
          onHide={closeModal}
          aria-labelledby="ModalHeader"
        >
          <Modal.Header closeButton>
            <Modal.Title id='ModalHeader'>A Title Goes here</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <p>Some Content here</p>
          </Modal.Body>
          <Modal.Footer>
            <Modal.Dismiss className='btn btn-default'>Cancel</Modal.Dismiss>
 
            <button className='btn btn-primary' onClick={saveAndClose}>
              Save
            </button>
          </Modal.Footer>
        </Modal>
      </div>
    )
  }
}


render(<App />, document.getElementById('app'));

Is `animate` property is obsolete?

I tried disabling animation by setting animate: false on modal as demonstrated in README.md, however the fade-in and translate animation were still active.

After inspecting in source code, I could not found any usage of animate property (except it being listed in propTypes list). Is it considered obsolete? If so, readme should probably be updated accordingly...

Setting transition: false disabled the animation - hovewer, some additional styling is then needed in adition to rbm-complete to set the opacity of backdrop...

If it is in fact obsolete, I can open a PR updating the readme (and cleanning up obsolete probTypes)..

How to use Stackable?

@jquense

Stackable! (use with constraint)

But how do I use it? I used it in different components, but it doesn't automatically manage that.

Modal-header default closeButton has no type='button' causing forms to treat it as a submit incorrectly

the default closeButton for modal-header renders as <button class="close" aria-label="Close Modal"><span aria-hidden="true">×</span></button>

can you please change the default to type="button" so it would be:
<button type="button" class="close" aria-label="Close Modal"><span aria-hidden="true">×</span></button>

When using forms this button is treated as a submit incorrectly because the type was never specified and the default for many browsers is 'submit'

New release with updated code?

Would you be able to publish a new version of this lib to npm, with the latest version of the repo? Looks like 5 commits are missing from the 3.0.1 release.

Would be nice to get the latest version of the lib straight from NPM :)

React 0.14 alpha is up on npm..

No idea if that will help you but today I installed react 0.14 just for fun.
package.json
"dependencies": {
"react": "0.14.0-alpha1"
}

Try it out, in case it helps you solve the : Warning: owner-based and parent-based contexts differ error.

onTransitionedOut triggered during animation

Hi,

the onTransitionedOut is triggered onExit (react-overlays) and thanks to that, the callback is triggered when animation starts. Probably should be called after the transition is ended (the onExited callback).

What do you think? Should i PR or you make the change?

Thanks,

Doc is really not up to date ?

So i looked into the code of the latest release,

there is no onEnter, onEntered, there is only onEntering.

There might be some other flaws... am i correct ?

React 0.14 compatability

Latest react-bootstrap-modal is 1.2.1 which I have in my package.json but I also have react and react-dom 0.14.0

Now I get this error:

ERROR in ./~/react-bootstrap-modal/lib/Modal.js
Module not found: Error: Cannot resolve module 'react/lib/getActiveElement' in /Users/peterbe/dev/JAVASCRIPT/activity/node_modules/react-bootstrap-modal/lib
 @ ./~/react-bootstrap-modal/lib/Modal.js 4:48-85

Is that because 1.2.1 is not compatible with react 0.14?

isMounted is deprecated

I'm having this warning every time modal is open.

Warning: Modal: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.

v4.1.0 on npm doesn't include less files.

Hi,

The new release on npm (4.1.0) doesn't have any lib folder so the less files are not in the package anymore.

If this was intentional then the readme is out of date. If it wasn't intentional then I guess the package is incorrect.

Strange backdrop behaviour

I used rbm in my project as,

<Modal aria-labelledby="archive-modal-header"
       onHide={this.onHideArchiveModal}
       show={this.state.showArchiveModal}>
  <Modal.Header closeButton>
    <Modal.Title id="archive-modal-header">
      Are you sure?
    </Modal.Title>
  </Modal.Header>
  <Modal.Body>
    <p>
      This operation cannot be undone. After archiving, project will
      disappear from UI, but you still be able to make Invoices from
      its Tracked Stories.
    </p>
    <p>
      <button className="btn btn-block btn-danger">
        OK! Archive {this.state.data.name} project
      </button>
    </p>
  </Modal.Body>
</Modal>

But when Modal opened, it visually displayed inside backdrop layer, not outside, so faded.

rbm-backdrop

I fixed this by passing backdrop={false} to Modal component, but I'd like to know what I'm missed for proper backdrop behaviour.

ps. Let me know if you need more details.

React v16 Support

this module is not working on react v16.
An error has occurred that is caused by portal.js
"Modal.Header, Modal.Body, Modal.Footer" is undefined

Cannot read property 'modals' of undefined

I am getting this error in the console:

Modal.js:136Uncaught TypeError: Cannot read property 'modals' of undefined

Due to the following code:

return function (type) {
        return baseIndex[type] + zIndexFactor * (_Modal2.default.manager.modals.length - 1);
};

multiple usages with different styles

Hi,
If I want to have the modal's height different with two different usages within the same app - is it possible?
I tried to override modal-content but then it globally changes the height which effects both instances...

Thanks in advance

Calls to `document` kill my isomorphic app.

Ok, I know this is probably not your problem but would you be kind enough to help me with it?

I get this error:

/Users/Dynopia/Development/DS_Stalker_Frontend/node_modules/react-bootstrap-modal/lib/Modal.js:26
  var modal = document.createElement("div"),
              ^
ReferenceError: document is not defined
    at /Users/Dynopia/Development/DS_Stalker_Frontend/node_modules/react-bootstrap-modal/lib/Modal.js:26:15
    at Object.<anonymous> (/Users/Dynopia/Development/DS_Stalker_Frontend/node_modules/react-bootstrap-modal/lib/Modal.js:46:3)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/Dynopia/Development/DS_Stalker_Frontend/bin/serverEntryPoint.js:1752:19)
    at __webpack_require__ (/Users/Dynopia/Development/DS_Stalker_Frontend/bin/serverEntryPoint.js:20:30)

I'm building an isomorphic app so calls to document in your Modal.js are TOTALLY accepted when they run browser side but NOT when they run on the server side through node.
What can I do to stop getting this error, its killing me..!

ps: I use 1 webpack config file for the server and 1 for client side.

Is it possible to have the modal appear beside the clicked button?

Hi,

I was wondering if it's possible to have the modal appear beside the clicked button without the background being out of focus?

Right now, this is what my page looks like and I'd like to have a small modal appear beside the clicked node on the tree but it covers the middle of the screen and makes the background out of focus.

Screen Shot 2019-07-26 at 3 45 52 PM

Screen Shot 2019-07-26 at 3 45 54 PM

Not showing in bootstrap 3.3.7

Hi, i use boostrap 3.3.7 and when i set the show property true, the backdrop is showing up, but the modal is not. When i check in developer console, i see the modal style still display: none.

I create a pr for this and the readme example.

Next release.. when?

Hi! Are there any plans or timings to release next version? As I see, fixes of React's warnings (like propTypes) were already committed and it will be great to see them officially. Can you orient when next version will be published? Thank you!

extending <ModalExample> for real-world use cases

I'm trying to develop a component '' based on this wrapper for Bootstrap's modal by extending the ModalExample given.

My use case is a table where each row i has a 'delete' button which, when clicked on, displays the ConfirmDialog modal and asks the user to confirm that they wish to delete row number i.

My questions are (a) how many components should I render, and (b) how to show/hide them.

In a non-React world, I would probably create a single ConfirmDialog instance, add an 'open/close' method, and call open() in the onClick handler for each parent row, passing along the index of the row and maybe some other information.
Maybe like this:

   let confirm = <ConfirmDialog> ... </ConfirmDialog>
   rows.map((r) => <Row onClick={confirm.open({ msg: `Do you really want to delete ${r.id}`, row: r.id })} > ...

(In fact, I can make this work in React.JS using the ref property to refer to the rendered 'ConfirmDialog', and access its open method in this way. But since the component will already have rendered, I can't pass along any information that depends on the row that caused it to open.)

In React - I can solve the problem of passing along per-row information by rendering one ConfirmDialog instance per row - which answers (a), and address problem (b) by adding state to the parent component that control's ConfirmDialog's show property to make each row's ConfirmDialog visible or not. Kind of like so:

   rows.map((r) => <div>
          <ConfirmDialog show={this.state.rowsOpen[i]}>Do you really want to delete {r.id}....
          <Row onClick={this.setState((clone state + set state.rowsOpen[i] to true)} > ///

when using redux, I would possibly have to dispatch an action just to set 'rowsOpen[i]' to true.

This seems wasteful and awkward though, although it is difficult to ascertain its true cost, given what React.JS does under the hood. But it may well be the idiomatic way.

I would appreciate an example or advice on how to use this provided component in a real-world context.

control width

Is it possible to control the width of the modal using a property? If so, how? I use this module in several places and the default behavior is fine, but I have one case where I need a narrow modal.

Unable to resolve relative paths

I'm trying to use react-bootstrap-modal in my project.

I installed with:

$ npm install --save react-bootstrap-modal

am importing with:

var Modal = require('react-bootstrap-modal');

Attempting to build my project using webpack 1.7.3. I get the error:

ERROR in ./~/react-bootstrap-modal/lib/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./lib/Modal in /Users/antony/home/src/chrome-extensions/tabman/node_modules/react-bootstrap-modal/lib
 @ ./~/react-bootstrap-modal/lib/index.js 2:17-39

It looks to me require is correctly reading ./node_modules/react-bootstrap-modal/package.json and following that to read ./node_modules/react-bootstrap-modal/lib/index.js but then choking on relative path "./lib/Modal" in that file.

Apologies if this issue is arcane to my build setup. Have you or others have used react-boostrap-modal in other webpack-based projects? If so a pointer to a github repo so that I can compare that config with mine would be much appreciated.

Option for modal-lg?

Any props I can pass down to give the modal dialog a modal-lg class? For a large modal?

addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded.

I get the above error when trying to show modal on clicking the a button on a table row.. Code below

ConfirmationModal.jsx

import React from 'react';

import Modal from 'react-bootstrap-modal';

console.log("logging", Modal)

const ConfirmationModal = (props) => {
  let closeModal = () => props.toggleHideModal;

  let saveAndClose = () => alert("hello");

  return(
    <div>
      <button type='button'>Launch modal</button>
      <Modal
        show={props.isModalShown}
        onHide={closeModal}
        aria-labelledby="ModalHeader"
      >
        <Modal.Header closeButton>
          <Modal.Title id='ModalHeader'>A Title Goes here</Modal.Title>
        </Modal.Header>
        <Modal.Body>
          <p>Some Content here</p>
        </Modal.Body>
        <Modal.Footer>
          // If you don't have anything fancy to do you can use 
          // the convenient `Dismiss` component, it will 
          // trigger `onHide` when clicked 
          <Modal.Dismiss className='btn btn-default'>Cancel</Modal.Dismiss>

          // Or you can create your own dismiss buttons 
          <button className='btn btn-primary' onClick={saveAndClose}>
            Save
          </button>
        </Modal.Footer>
      </Modal>
    </div>
  );
}

export default ConfirmationModal;

The parent : CampaignTable.jsx

import React, { Component } from 'react';

import CampaignTableRow from './CampaignTableRow';
import ConfirmationModal from './ConfirmationModal';

const CampaignTable = (props) => {
    const campaignList = props.campaigns.map((campaign) => {
        return <CampaignTableRow campaign={campaign}
          key={campaign.id}
          markCampaignActive={props.markCampaignActive}
          toggleShowModal={props.toggleShowModal}
          />
    });
    return (
      <div className="container dashboard-parent">
        <h3>All AMAs</h3>
        <div className="dashboard-table">
          <table className="table">
            <thead>
              <tr>
                <th>Ama Event name</th>
                <th>Status</th>
                <th>Action</th>
                <th>Edit Action</th>
              </tr>
            </thead>
            <tbody>
              { campaignList }
            </tbody>
          </table>
        </div>
        {
          props.isModalShown ? <ConfirmationModal
            isModalShown={props.isModalShown}
            toggleHideModal={props.toggleHideModal}
            toggleShowModal={props.toggleShowModal}
            markCampaignActive={props.markCampaignActive}
         /> : ''
        }
      </div>
    )
}

export default CampaignTable;

I get the error when i click on a row of the table mentioned above code is below

CampaignTableRow.jsx

import React, { Component } from 'react';
import { Link } from 'react-router';

const CampaignTableRow = (props) => {
  console.log(props);
  const activateFlag = props.campaign.active ? 0 : 1;
  return (
    <tr>
      <td>{props.campaign.name}</td>
      <td>{props.campaign.active ? 'Live' : 'Not Live' }</td>
      <td>
        <span className={props.campaign.active ? 'btn btn-default' : 'btn btn-primary'}
          onClick={() => props.toggleShowModal()}>
          {props.campaign.active ? 'Deactivate' : 'Activate' }
        </span>
      </td>
      <td>
        <Link className="btn edit-btn" to={`/consult/ama/${props.campaign.slug}/edit`}>Edit AMA</Link>
      </td>
    </tr>
  );
}

export default CampaignTableRow;

using

"react": "^15.3.2",
"react-dom": "^15.3.2"

Is there any way to may the react- bootstrap-modal draggable/ resizeable?

Hi,

We have been using react-bootstrap 0.29.0 version for Modal dialogs in our application, recently we want to support dragging of the Modal dialogs in our application. There are couple of libraries that we found for making it draggable but for supporting Modal React component most of them has open issues. So it there any way inbuilt in react-bootstrap-modal to support the draggable/ resizable feature through any methods/ props?

If not then is there any plan to add this support to the library in near future? Cause it seems to be the quite a popular feature for Modals these days.

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

Even after updating to @3.0.1, we are still seeing deprecation warnings related to PropTypes. It seems like it is happening in the src for Portal. The compiled code looks like this:

var Portal = _react2.default.createClass({
	  ...
	  propTypes: {
	    /**
	     * A Node, Component instance, or function that returns either. The `container` will have the Portal children
	     * appended to it.
	     */
	    container: _react2.default.PropTypes.oneOfType([_componentOrElement2.default, _react2.default.PropTypes.func])
	  },
          ...

Dismiss doesn't trigger Cancel

So this is my PrintModal component using react-bootstrap-modal

/**
 * PrintModal : This is a compnent that warn the user for printing. It opens a print dialog warning.
 */

import React, {PropTypes} from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import PubSub from 'pubsub-js';
import s from './PrintModal.less';
import Modal from 'react-bootstrap-modal';


class PrintModal extends React.Component {

  constructor(props) {
    super(props);

    this.state = {};
  }

  componentWillMount() {
    this.openPrintModalNotifier = PubSub.subscribe('print.openPrintModal', (topic, time) => {
      console.log("printing modal open");
      this.setState({modalIsOpen: true});
    });
  }

  componentWillUnmount() {
    PubSub.unsubscribe(this.openPrintModalNotifier);
  }

  render() {
    let closeModal = () => this.setState({modalIsOpen: false});

    return (
      <div>
        <Modal
          show={this.state.modalIsOpen}
          onHide={this.closeModal}>

          <Modal.Header closeButton>
            <Modal.Title id='ModalHeader'>Before you print...</Modal.Title>
          </Modal.Header>
          <Modal.Body>


            Terms and conditions

            <p>Please respect copyright, the artists and composers and all the individuals who work hard to bring you
              this
              music.</p>

            <p>Every title on our website is legally authorized by the songwriter and licensed from them (or their
              publisher).</p>

            <p>Songwriters earn their living from the revenue generated from each sale. All works are protected by
              copyright
              law and it is unlawful to photocopy or distribute this work either physically or electronically without
              consent so please do not do so.</p>

            <p>You are only entitled to print the number of copies you have purchased and by pressing "Print" you agree
              to
              our full terms and conditions.</p>

            <p><strong>Printing tips</strong></p>

            <ol>
              <li>Carefully check your browser print settings, making sure to switch off <strong>headers and
                footers</strong> and set <strong>margins to zero</strong>.
              </li>
              <li>Make sure your printer is plugged in and switched on, and is well stocked with ink and paper. This
                score
                has <strong>{this.props.numberOfPage} page(s).</strong></li>
            </ol>
          </Modal.Body>
          <Modal.Footer>
            {/* If you don't have anything fancy to do you can use
             the convenient `Dismiss` component, it will
             trigger `onHide` when clicked
              */}
            <Modal.Dismiss className='btn btn-default'>Cancel</Modal.Dismiss>
          </Modal.Footer>
        </Modal>
      </div>
    );
  }
}

export default withStyles(s)(PrintModal);

When I hit, Cancel, nothing is dismissed. Either the Close (X) button is not working.

Can not get the close button label to align properly.

The label sits on the bottom edge of the close button.
I have tried adding my own styling to the button label (negative margin, etc) but nothing worked for me. See the image for the problem. (I tried to attach the image, but only get a link to github. Does this work for you?)
capture

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Modal closes when selecting text and releasing mouse outside - Chrome 73 click event target

Browser version:

Chrome 73.0.3683.86

Original install method (e.g. download page, yum, from source, etc.):

Docker

Describe the bug:

Modal closes when releasing the mouse button after selecting text.

Steps to reproduce:

  1. Open a Modal with a text input (https://codepen.io/blopa-the-bold/pen/NmqRYK)
  2. Type something in the text input
  3. Drag left to select the text. Keep going past the boundary of the Modal, and release the mouse.
  4. The Modal will close.

Expected behavior:

The Modal should not close on mouse up, only on mouse down.

Screenshots (if relevant):

Gif

Extra info:

This seems to be a problem introduced on Chrome 73. Some other packages already fixed it in their code base, like elastic/eui#1747

Breaking Bug

The patched css provided with this library breaks any modals that were not created through this library/react. For instance if a page contained just the html markup for a modal it breaks due to the following code:

.modal {
  display: block
}

These other modals now will render on top of everything on the page but still be invisible and non-interactive so from the user perspective the entire page becomes unresponsive, but really its just that the modal is masking everything on the page and the user cannot dismiss it or see that it is there.

I am not sure why it was added or what its purpose is, it was introduces in this commit which has a huge diff and whose commit message is "boom".

Using refs inside components doesn't work

I have the following snippet inside a render:

<Modal show={this.state.open} onHide={closeModal} aria-labelledby="ModalHeader">
    <Modal.Header closeButton>
        <Modal.Title id="ModalHeader">This shouldn't be as ugly</Modal.Title>
    </Modal.Header>
    <Modal.Body>
        <input type="text" ref="input" />
    </Modal.Body>
    <Modal.Footer>
        <Modal.Dismiss className="btn">Cancel</Modal.Dismiss>
        <button className="btn" onClick={this.click.bind(this)}>Add</button>
    </Modal.Footer>
</Modal>

In the click routine, the value this.refs.input is undefined. Is there a way I can use a ref inside the Modal components?

Cannot read property 'modals' of undefined

How can we fix this issue that happens to appear everytime.

Uncaught TypeError: Cannot read property 'modals' of undefined
    at getZIndex (Modal.js:137)
    at Modal._getStyles (Modal.js:250)
    at Modal._show (Modal.js:143)
    at eval (Transition.js:140)
    at Transition.nextCallback (Transition.js:195)
    at CallbackQueue.notifyAll (CallbackQueue.js:76)
    at ReactUpdatesFlushTransaction.close (ReactUpdates.js:59)
    at ReactUpdatesFlushTransaction.closeAll (Transaction.js:206)
    at ReactUpdatesFlushTransaction.perform (Transaction.js:153)
    at ReactUpdatesFlushTransaction.perform (ReactUpdates.js:89)

thanks

Autofocus lost inside this Modal.

I'm trying to autoFocus a username Input inside this modal and I find this impossible.
Does your Modal eat up my autofocus?

How should I do this?

npm module not published?

When I "npm install react-bootstrap-modal", the onTransition* callbacks still do not fire, but if I git-clone master and build and use that, the onTransition* callbacks do fire. Leads me to believe this thing has noot been pushed to the npm repo.

onTransition handlers not fired

onTransitionIn
onTransitionedIn
onTransitionOut
onTransitionedOut

These 4 event handlers of Modal are not fired when they should according to the description.

Warning: `div` was passed a style object that has previously been mutated.

How can fix it error?

Warning: `div` was passed a style object that has previously been mutated. Mutating `style` is deprecated. Consider cloning it beforehand. Check the `render` of `Modal`. Previous style: {zIndex: NaN}. Mutated style: {zIndex: NaN}.
warning @ warning.js:45
checkAndWarnForMutatedStyle @ ReactDOMComponent.js:186
_updateDOMProperties @ ReactDOMComponent.js:770
updateComponent @ ReactDOMComponent.js:699
receiveComponent @ ReactDOMComponent.js:645
receiveComponent @ ReactReconciler.js:87
_updateRenderedComponent @ ReactCompositeComponent.js:562
_performComponentUpdate @ ReactCompositeComponent.js:544
updateComponent @ ReactCompositeComponent.js:473
ReactCompositeComponent_updateComponent @ ReactPerf.js:66
performUpdateIfNecessary @ ReactCompositeComponent.js:421
performUpdateIfNecessary @ ReactReconciler.js:102
runBatchedUpdates @ ReactUpdates.js:129
perform @ Transaction.js:136
perform @ Transaction.js:136
perform @ ReactUpdates.js:86
flushBatchedUpdates @ ReactUpdates.js:147
ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66
closeAll @ Transaction.js:202
perform @ Transaction.js:149
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
enqueueUpdate @ ReactUpdates.js:176
enqueueUpdate @ ReactUpdateQueue.js:24
enqueueSetState @ ReactUpdateQueue.js:190
ReactComponent.setState @ ReactComponent.js:65
safeSetState @ Transition.js:181
(anonymous) @ Transition.js:143
nextCallback @ Transition.js:195
setTimeout (async)
onTransitionEnd @ Transition.js:212
(anonymous) @ Transition.js:142
nextCallback @ Transition.js:195
notifyAll @ CallbackQueue.js:65
close @ ReactUpdates.js:57
closeAll @ Transaction.js:202
perform @ Transaction.js:149
perform @ ReactUpdates.js:86
flushBatchedUpdates @ ReactUpdates.js:147
ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66
close @ ReactUpdates.js:45
closeAll @ Transaction.js:202
perform @ Transaction.js:149
perform @ ReactUpdates.js:86
flushBatchedUpdates @ ReactUpdates.js:147
ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66
closeAll @ Transaction.js:202
perform @ Transaction.js:149
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:94
dispatchEvent @ ReactEventListener.js:204
00:35:58.821 polling-xhr.js:264 GET https://testing-ws2.helptalks.ru/socket.io/?auth_token=Wzc2MiwxNDk2MzE0ODQ2LjM0NTAwOF0.Ra6yfxW9_jEV4XUeKVTO-E4emak&EIO=3&transport=polling&t=LnWRk9h 504 (Gateway Time-out)
Request.create @ polling-xhr.js:264
Request @ polling-xhr.js:165
XHR.request @ polling-xhr.js:92
XHR.doPoll @ polling-xhr.js:122
Polling.poll @ polling.js:118
Polling.doOpen @ polling.js:63
Transport.open @ transport.js:80
Socket.open @ socket.js:246
Socket @ socket.js:120
Socket @ socket.js:29
Manager.open.Manager.connect @ manager.js:226
Manager @ manager.js:69
Manager @ manager.js:37
lookup @ index.js:60
setSocket @ App.js:103
componentDidMount @ App.js:199
notifyAll @ CallbackQueue.js:65
close @ ReactReconcileTransaction.js:81
closeAll @ Transaction.js:202
perform @ Transaction.js:149
batchedMountComponentIntoNode @ ReactMount.js:282
perform @ Transaction.js:136
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:94
_renderNewRootComponent @ ReactMount.js:476
ReactMount__renderNewRootComponent @ ReactPerf.js:66
_renderSubtreeIntoContainer @ ReactMount.js:550
render @ ReactMount.js:570
React_render @ ReactPerf.js:66
(anonymous) @ index.js:20
__webpack_require__ @ bootstrap 7d35664…:19
(anonymous) @ bootstrap 7d35664…:39
(anonymous) @ bootstrap 7d35664…:39

display: none on Modal.

Hello! I'm having an issue where the transparent backdrop is being displayed, but the modal content itself is not. It's not being displayed because .modal {} has a display: none attribute and it is not being overriden. Please see attached screenshot. I'm using bootstrap 3.3.5.

screen shot 2015-12-17 at 9 44 04 am

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.