react-bootstrap

React Bootstrap OverlayTrigger and Tooltip issue

烂漫一生 提交于 2019-12-01 04:29:19
问题 I am trying to use react-bootstrap OverlayTrigger and Tooltip inside of a formatter for react-bootstrap-table and keep getting the following error: OverlayTrigger's only required prop is overlay which is supposed to be a node and Tooltip's only required prop is id (despite none of their examples showing that you need an ID) which needs to be a string. "onlyChild must be passed a children with exactly one child." relevant code in question looks like: import {Button, DropdownButton, MenuItem,

Override TypeScript types in V2.2.2 downloaded from NPM @Types

两盒软妹~` 提交于 2019-11-30 20:06:26
问题 I'm using the component react-router-bootstrap and definitions from DefinitelyTyped. My problem is that the definitions downloaded does not match the component. I have created a pull request that will solve this but since I do not know when it will be patched I have to override it. I cannot just edit the type definitions file located in node_modules\@types locally because we are a team working on this project and the node_modules folder is not checked in. How can I override type definitions?

React Bootstrap - How to manually close OverlayTrigger

倾然丶 夕夏残阳落幕 提交于 2019-11-30 11:23:15
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</Button> </Popover> }> I have rootClose = true , and my callback gets executed onExit , but I don't see a

Listen to keypress for document in reactjs

青春壹個敷衍的年華 提交于 2019-11-30 10:52:28
问题 I want to bind to close the active react bootstrap popover on escape press .Here is the code _handleEscKey:function(event){ console.log(event); if(event.keyCode == 27){ this.state.activePopover.hide(); } }, componentWillMount:function(){ BannerDataStore.addChangeListener(this._onchange); document.addEventListener("click", this._handleDocumentClick, false); document.addEventListener("keyPress", this._handleEscKey, false); }, componentWillUnmount: function() { BannerDataStore

How to open/close react-bootstrap modal programmatically?

偶尔善良 提交于 2019-11-30 03:02:10
I need to open/close modal like $(element).modal('show') How to do that? What you are looking for is the custom modal trigger, which uses the OverlayMixin and allows you to manage the modal's state yourself. You can control whether the modal is shown using this.setState({isModalOpen: true}) to achieve the equivalent of what you asked for in your post in the example below. The following code is from the react-bootstrap website ( http://react-bootstrap.github.io/components.html#modals ): const CustomModalTrigger = React.createClass({ mixins: [OverlayMixin], getInitialState() { return {

Listen to keypress for document in reactjs

扶醉桌前 提交于 2019-11-29 22:46:17
I want to bind to close the active react bootstrap popover on escape press .Here is the code _handleEscKey:function(event){ console.log(event); if(event.keyCode == 27){ this.state.activePopover.hide(); } }, componentWillMount:function(){ BannerDataStore.addChangeListener(this._onchange); document.addEventListener("click", this._handleDocumentClick, false); document.addEventListener("keyPress", this._handleEscKey, false); }, componentWillUnmount: function() { BannerDataStore.removeChangeListener(this._onchange); document.removeEventListener("click", this._handleDocumentClick, false); document

Missing col-xs sizes using bootstrap 4 [duplicate]

旧街凉风 提交于 2019-11-29 07:41:36
This question already has an answer here: `col-xs-*` not working in Bootstrap 4 2 answers 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 The -xs- infix was removed from Bootstrap 4 Alpha 6, so the classes are simply, col-1 , col-2 .. col-12 , etc... Since Bootstrap is "mobile first", the xs breakpoint (<576px) is the default and are no media queries for it.

Can we use pure Bootstrap with React.js?

跟風遠走 提交于 2019-11-29 07:09:56
I would like to convert websites from PSD prototype to HTML/CSS/Bootstrap and then move on to JavaScript development and using React.js and some JavaScript coding. Is it possible to use pure Bootstrap with React.js without using React-Bootstrap? Also is it possible HTML/CSS Freelancer to do React-Bootstrap as a mockup only and then find a JavaScript developer to do the advance work like React.js and JS development? I would like to develop app for Desktop using Electron and Hybrid App using same code base as possible. In theory, yes. Since ReactComponent render themselves as html, you can just

webpack2: how to import Bootstrap CSS for react-bootstrap to find its styles?

喜夏-厌秋 提交于 2019-11-29 04:47:50
I am using webpack 2 and react-bootstrap in my project ; I can't find how to have bootstrap CSS styles properly applied it seems like the .css file is not loaded, no matter which import statement I tried to use. As far as I understand I do not need the full bootstrap package with javascript etc. since I am using react-bootstrap ; I just need the CSS. So I added this in my main.js file: import 'bootstrap/dist/css/bootstrap.css'; It seems to work (no error message) but the styles are not applied... I configured the css loader in my webpack config file as described on webpack 2 documentation. Any

Changing style of a button on click

跟風遠走 提交于 2019-11-29 01:38:21
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-left: -15px; padding-bottom: -20px; padding: 0; } `}</style> <ButtonToolbar> <ButtonGroup>