react-bootstrap

React Bootstrap - How to manually close OverlayTrigger

别说谁变了你拦得住时间么 提交于 2019-12-18 14:17:12
问题 I have an OverlayTrigger wrapping a Popover that contains some form inputs and a Button to save the data and close. save(e) { this.setState({ editing: false }) this.props.handleUpdate(e); } render() { return ( <OverlayTrigger trigger="click" rootClose={true} onExit={this.save.bind(this) } show={this.state.editing} overlay={ <Popover title="Time Entry"> <FormGroup> <ControlLabel>Data: </ControlLabel> <FormControl type={'number'}/> </FormGroup> <Button onClick={this.save.bind(this) }>Save<

Missing col-xs sizes using bootstrap 4 [duplicate]

主宰稳场 提交于 2019-12-18 04:55:12
问题 This question already has answers here : `col-xs-*` not working in Bootstrap 4 (3 answers) Closed 9 months ago . In my react project, using react-bootstrap, it's loading all all the css for the grid sizes, except for the xs set. the xs set does, however, get the default styles applied to all grid sizes, but does not include the media query. Is there something obvious I am missing? Bootstrap 4 回答1: The -xs- infix was removed from Bootstrap 4 Alpha 6, so the classes are simply, col-1 , col-2 ..

Changing style of a button on click

馋奶兔 提交于 2019-12-18 02:16:23
问题 Is it possible to change background-color of my button onClick function? ex. click background-color: black , another click background-color: white I've tried something like this.style , no result. I've managed to get overlay working and insert needed data inside of it. But didn't managed to find any post that could help me. I am using react-bootstrap. This is my code. const metaDataOverlay = ( <div> <style type="text/css">{` .btn-overlay { background-color: white; margin-right: -15px; margin

Unexpected Token after const

依然范特西╮ 提交于 2019-12-13 12:28:13
问题 I am getting an unexpected token error in React when I try to specify a constant, and I cannot seem to figure out why. My code is pretty simple, and I have followed the react-bootstrap examples here almost exactly. My code is as follows: import { Component, PropTypes } from 'react'; var rbs = require('react-bootstrap'), Panel = rbs.Panel; export default class ResumeSection extends Component { constructor(...args) { super(...args); this.state = { open: true }; } const title = ( <h3>Panel title

React how to close a popover with a modal

◇◆丶佛笑我妖孽 提交于 2019-12-13 07:25:43
问题 With react-bootstrap, I have a popover that contains a list. On click of one of the list items, it opens a modal. How to close the popover when the modal is opening? I tried: rootClose but it's not working React Bootstrap - How to manually close OverlayTrigger, that close both, the popover and the modal class TypeColumn extends React.Component { constructor(props, context) { super(props, context); this.close = this.close.bind(this); } close() { this.refs.overlay.hide(); } render() { const

Do I need to install React before I install react-bootstrap

纵然是瞬间 提交于 2019-12-13 06:14:21
问题 I am trying to install react-bootstrap. When I run the command npm install react-bootstrap --save I get the following (some path names replaced with '...') : npm WARN saveError ENOENT: no such file or directory, open '/Users/../package.json'/Users/.../.. ├── UNMET PEER DEPENDENCY react@>=0.14.0 ├─┬ react-bootstrap@0.30.7 │ ├─┬ babel-runtime@6.20.0 │ │ ├── core-js@2.4.1 │ │ └── regenerator-runtime@0.10.1 │ ├── classnames@2.2.5 │ ├── dom-helpers@2.4.0 │ ├─┬ invariant@2.2.2 │ │ └─┬ loose-envify

react-bootstrap ModalTrigger doesn't hide when the parent element is unmounted

旧时模样 提交于 2019-12-12 17:00:14
问题 We encountered a strange behavior when using react-bootstrap's ModalTrigger with an array of items, in that it doesn't go away when the parent/owner item is unmounted. We suspect this has to do with React's virtual DOM and the diffing mechanism, and/or our own misuse of the ModalTrigger. The setup is simple: a Content react component has a state that holds an array of item names. It also has an onClick(name) function that removes that name from the array via setState. In the render, it uses _

Can't use onChange with react-bootstrap ToggleButtonGroup

二次信任 提交于 2019-12-12 14:46:26
问题 So it's been a couple of hours since I spotted this problem and it's getting weirder every minute. The main issue is I can't manage to make the onChange event work on a ToggleButtonGroup. My code: class ToggleButtonGroupControlled extends React.Component { constructor(props, context) { super(props, context); this.state = { value: [1, 3], }; this.onChange = this.onChange.bind(this); } onChange(value){ alert(value); this.setState({ value }); }; render() { return ( <ToggleButtonGroup type=

React - Authentication process : Cannot dispatch in the middle of a dispatch

安稳与你 提交于 2019-12-12 12:22:59
问题 I have started to play with react via flummox, react-bootstrap and react-router. I am trying to create a basic isomorphic CMS out of it for my websites. Context : In terms of authentication, each user has a list of capabilities and each component uses a method of my authentication store "can" to be displayed or not, etc... I have a user navbar on top, visible on every page handled by reat-router, with a signin/out button that basically displays on click a Modal with a signin form if the user

Error rendering react-bootstrap components

坚强是说给别人听的谎言 提交于 2019-12-12 12:08:15
问题 I have recently migrated from using twitter-bootstrap in react classes to using react-bootstrap. I wanted to test out react-bootstrap Navbar. My code is as: import React from 'react'; import { Link } from 'react-router'; import Radium from 'radium'; import Grid from 'bootstrap-grid-react'; import * as bootstrap from "react-bootstrap"; export default class Layout extends React.Component { constructor() { super(); this.state = {}; } render() { let {Nav, Navbar, NavItem, NavDropdown, MenuItem} =