GithubHelp home page GithubHelp logo

Comments (5)

dhh avatar dhh commented on May 28, 2024 1

Can't replicate when using Bootstrap 5.0 example code from here: https://getbootstrap.com/docs/5.0/components/navbar/

Works out of the box with rails new app --css bootstrap -j rebuild.

Looks like the problem is that your HTML contains data attributes not recognized by Bootstrap 5.0. You have:

 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

You need:

 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

from cssbundling-rails.

jasonfb avatar jasonfb commented on May 28, 2024 1

Confirmed--- I was using the example navbar code from Bootstrap 4. My mistake. Thank you @dhh

from cssbundling-rails.

jasonfb avatar jasonfb commented on May 28, 2024

I can see based on tutorials on the internet and also based on the wrong answers on this SO post https://stackoverflow.com/questions/71216446/bootstrap-5-1-not-working-in-jsbundling-rails-7

that perhaps this was working once about a year ago?
I have been testing against Rails 7.0.4

from cssbundling-rails.

jasonfb avatar jasonfb commented on May 28, 2024

I also tested against Rails 7.0.0 and got the same result. I do not see why others seem to get a different result here,I tried this on two separate machines using Ruby 3.1.3 and Node 16.17.1

from cssbundling-rails.

jasonfb avatar jasonfb commented on May 28, 2024

is the problem here that the JS part of Boostrap just doesn't work with ESBUILD?

If I add back importmaps and then PIN the Bootstrap dependencies, it works.

from cssbundling-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.