Search code examples
javascriptjquerytwitter-bootstrap-3prototypepopover

Prototype with Boostrap 3.3.4 popover bug


When using both prototype and bootstrap 3.3.4, there is a glitch where a popovers' parent element is hidden along with the popover when the hide.bs.* event is called. After several days of searching for a solution to this old issue and coming across nothing but outdated answers that are no longer valid for the most recent bootstrap release, I've finally decided to ask if anyone has a solution to this issue.


Solution

  • Step 1: Open bootstrap.js

    Step 2: Find the "Tooltip.prototype.hide" function

    Step 3: Replace the following line of code:

    this.$element.trigger(e)
    

    with this

    if( this.type != 'popover') {
        this.$element.trigger(e)
    }
    

    And that's it.

    If anyone has a better solution to this issue, please let me know. I'd rather not alter the core js file if I don't have to.