seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 996 forks source link

Mobile navbar does not collapse after first expand #869

Closed ghost closed 8 years ago

ghost commented 9 years ago

The navbar on mobile device does not collapse after expanding the menu once.

Using Ruby 2.0.0-p645, the Gemfile I'm using is:

source 'https://rubygems.org'

gem 'rails', '3.2.21'

gem 'sqlite3'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'

  gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
  gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
end

gem 'jquery-rails'

The example I used to generate the navbar is taken from [http://bootstrapdocs.com/v3.2.0/docs/components/#navbar-default]

As for a stacktrace, I was unable to capture/replicate a log through my browser. However, I did catch a glimpse of a deprecation warning of what I think originated from jQuery.

palidanx commented 8 years ago

After browsing around, I saw doing this works

http://stackoverflow.com/questions/25878450/bootstrap-collapsed-navbar-buggy-open

.navbar-collapse.collapse.in {
  display: block!important;
}
ghost commented 8 years ago

Thanks @palidanx !

palidanx commented 8 years ago

But shouldn't this work though? I kind of feel that the css is a patch. I tested it with an earlier version of bootstrap 3 and it worked so something is funky.