I've been wanting to migrate from Bootstrap 4 to Bootstrap 5. One reason for making the jump is that BS5 drops its dependency on JQuery - often the center of security issues.

I thought little of upgrading aside from swapping out CDN JS/CSS files. Upon upgrading, though, my site broke. Dropdowns stopped working, the layout got wonky.

I reverted the commit and checked Bootstrap's excellent doc on migrating to BS5. BS5 introduced many breaking changes.

Breaking Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. For example, we use data-bs-toggle instead of data-toggle.

After refactoring, everything works again 🤞

Comments

Back to Home
John Solly Profile Picture
John Solly Profile Picture

John Solly

Hi, I'm John, a Software Engineer with a decade of experience building, deploying, and maintaining cloud-native geospatial solutions. I currently serve as a senior software engineer at New Light Technologies (NLT), where I work on a variety of infrastructure and application development projects.

Throughout my career, I've built applications on platforms like Esri and Mapbox while also leveraging open-source GIS technologies such as OpenLayers, GeoServer, and GDAL. This blog is where I share useful articles with the GeoDev community. Check out my portfolio to see my latest work!