JavaScript Popover not hide when hovering over it popover hide when click outside,popover hide on click,popover

I manage to make that work using one of the comments that ochi posted.

 <OverlayTrigger trigger={["hover"]} placement="bottom" overlay={(
    <Popover onMouseOver={this.showOverlay} onMouseOut={this.hideOverlay}>
        content
    </Popover>
 )}>
    <div onMouseOver={this.showOverlay} onMouseOut={this.hideOverlay}>
        <div>bla bla bla</div>
    </div>
 </OverlayTrigger>

adding trigger on the popover and on the div i want to trigger worked.

Answer:1

I was looking to do the same thing using React Bootstrap except with a tooltip instead of a popover. The answer here gave me a good jumping off point, which I mixed with the Custom Overlay example in the React Bootstrap docs.

I replaced OverlayTrigger with a custom Overlay, which wraps the Tooltip but is outside of the target element, whereas the OverlayTrigger wraps the target element and calls Tooltip through the overlay prop. I added onMouseEnter() and onMouseLeave() to both the tooltip and the target element to toggle the tooltip visibility state so that leaving either one will close the tooltip.

This is a bare-bones version of my implementation:

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Tooltip, Overlay } from 'react-bootstrap';

const TooltipExample extends Component {
  constructor(props) {
    super(props);

    this.state = {
      showTooltip: false,
    };
  }

  render() {
    let myTooltip = (
      <Tooltip 
        onMouseEnter={() => this.setState({ showTaskTooltip: true })}
        onMouseLeave={() => this.setState({ showTaskTooltip: false })}
      >
        I'm a tooltip and I'll stay open when you leave the target element and hover over me!
      </Tooltip>
    );

    return(
      <div>
        <h3
          ref="target"
          onMouseEnter={() => this.setState({ showTooltip: true })}
          onMouseLeave={() => this.setState({ showTooltip: false })}
        >
          Hover over me!
        </h3>

        <Overlay
          show={this.state.showTooltip}
          onHide={() => this.setState({ showTooltip: false })}
          placement="bottom"
          target={() => ReactDOM.findDOMNode(this.refs.target)}
        >
          {myTooltip}
        </Overlay>
      </div>
    );
  }  
}

export default TooltipExample;
Answer:2

So I am building a drag and drop form builder and I want to make a particular field on all the inputs readOnly. This can be Select Dropdown Text input Number input Date input Date input All these ...

So I am building a drag and drop form builder and I want to make a particular field on all the inputs readOnly. This can be Select Dropdown Text input Number input Date input Date input All these ...

  1. make only inputs with type 'text'
  2. make a sentence with inputs

tl;dr: How can I chain onto Javascript's map() with my own function? Like - stuff.map(i => i.key).avg() where avg() is my own function to compute the average of the array returned by map? In ...

tl;dr: How can I chain onto Javascript's map() with my own function? Like - stuff.map(i => i.key).avg() where avg() is my own function to compute the average of the array returned by map? In ...

I am working on google bar charts but I am not able to change the background color of google barcharts. Here is my code: <script type="text/javascript"> google.load('visualization', '1', {...

I am working on google bar charts but I am not able to change the background color of google barcharts. Here is my code: <script type="text/javascript"> google.load('visualization', '1', {...

  1. change background google docs
  2. change background google slides
  3. change background google chrome
  4. change background google drawing
  5. change background google calendar
  6. change background google hangouts
  7. change background google slides app
  8. change background google sites
  9. change background google drive
  10. change background google search page
  11. change background google home hub
  12. change background google sheets
  13. change background google hub
  14. change background google slides ipad
  15. change background google earth
  16. change background google forms
  17. change background google chromecast
  18. change background google account

Table doesn't cover all div, but i give a width in 100% $("#astana").click(function(){ $(".t2").toggle(500); }); /*---tables---*/ .wrapper { margin: 0 auto; max-width: 800px; } ...

Table doesn't cover all div, but i give a width in 100% $("#astana").click(function(){ $(".t2").toggle(500); }); /*---tables---*/ .wrapper { margin: 0 auto; max-width: 800px; } ...