Conversejs Bootstrap 4 conflict fix - createIT
Get a free advice now!

    Pick the topic
    Developer OutsourcingWeb developingApp developingDigital MarketingeCommerce systemseEntertainment systems

    Thank you for your message. It has been sent.
    Tags

    Conversejs Bootstrap 4 conflict fix

    Conversejs Bootstrap 4 conflict fix

    CHALLENGE: Use conversejs chat on a site that is already using Bootstrap 4

    SOLUTION: Edit plugin source and change data attribute name to resolve the conflict between Boostrap Native and Boostrap Framework

    Converse.js is an open-source XMPP chat in the browser, one that is easy to set up and integrate into your own website. The solution has a vast community, with over 130 people contributing additional features, bugfixes and language support. 

    Version 5.0.5 release included multiple improvements: preventing the editing of sent file uploads, fixing new message notifications for a minimized chat stack on top of each other and now chats are hidden behind the controlbox on mobile. Conversejs as a javascript plugin is often updated with bug-fixes and new features, it’s using Bootstrap Native Library for UI. BSN is just a Boostrap framework, but without jQuery dependency.

    Our website was already using Bootstrap 4 framework, and turns out that enqueuing https://cdn.conversejs.org/5.0.5/dist/converse.min.js created some conflicts on the page:

    • Bootstrap tabs weren’t working correctly
    • Issues with the modal backdrop layer

    A fix for making converse.js chat working correctly with BS4 (BSN conflict)

    • Instead of using CDN – just create a custom build, or use static js file for converse.min.js
    • Replace all occurrences of data-toggle with data-cttoggle
    • Change modal initialize() function: replace
    backdrop: 'static'

    with

    backdrop: false

    Summary
    That’s it. Now BoostrapNative from converse.js is using custom data attribute name and will not be in conflict with the original Boostrap Framework.

    More info

    <script src="/js/converse.js" charset="utf-8"></script>

    Follow us for other useful tips and guidelines.

    Comments
    0 response

    Add comment

    Your email address will not be published. Required fields are marked *

    Popular news

    Automating stock and price updates in WooCommerce
    • Dev Tips and Tricks

    Automating stock and price updates in WooCommerce

    September 23, 2024 by createIT
    Integrating advanced subscription features in WooCommerce
    • Dev Tips and Tricks

    Integrating advanced subscription features in WooCommerce

    September 16, 2024 by createIT
    Fetching Time records from ActiveCollab API
    • Dev Tips and Tricks

    Fetching Time records from ActiveCollab API

    September 9, 2024 by createIT
    Docker Compose for PrestaShop
    • Dev Tips and Tricks

    Docker Compose for PrestaShop

    September 2, 2024 by createIT
    WordPress wizard in admin – step by step
    • Dev Tips and Tricks

    WordPress wizard in admin – step by step

    August 29, 2024 by createIT
    Order Status Sync between PrestaShop and External APIs
    • Dev Tips and Tricks

    Order Status Sync between PrestaShop and External APIs

    August 26, 2024 by createIT
    What is PHP used for in web development 
    • Dev Tips and Tricks

    What is PHP used for in web development 

    August 22, 2024 by createIT
    Automating WooCommerce product availability date
    • Dev Tips and Tricks

    Automating WooCommerce product availability date

    August 15, 2024 by createIT
    WP Quiz Adventure – FAQ
    • Dev Tips and Tricks

    WP Quiz Adventure – FAQ

    August 12, 2024 by createIT

    Support – Tips and Tricks
    All tips in one place, and the database keeps growing. Stay up to date and optimize your work!

    Contact us