Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Reactstrap 5.x Dropdowns do not work correctly #57

Closed
iaincollins opened this issue Jan 6, 2018 · 1 comment
Closed

Reactstrap 5.x Dropdowns do not work correctly #57

iaincollins opened this issue Jan 6, 2018 · 1 comment
Labels

Comments

@iaincollins
Copy link
Owner

They don't render correctly on mobile, and they don't work without JavaScript enabled on the client.

These are both issues with Reactstrap. The former is likely to be fixed in updates to Reactstrap 5.x alpha, but the latter will require additional work if we want to resolve that.

As the site supports universal rendering and sessions I'd like to resolve the issue with navigation.

@iaincollins iaincollins added the bug label Jan 6, 2018
iaincollins added a commit that referenced this issue Jan 6, 2018
Partly addresses issues in #57

* Dropdown menus in the nav menu on mobile now display correctly.
* The nav menu no longer requires JavaScript to be enabled to work and uses a pure CSS solution. I may prototype to extend this to other components and see if it’s a pull request the Reactstrap folks would be interested in.
iaincollins added a commit that referenced this issue Jan 6, 2018
This provides some support for issues rasied in #57 and #59.
@iaincollins
Copy link
Owner Author

The issue with dropdown menus in the navbar not rendering properly on mobile has been fixed with CSS.

.navbar .dropdown {
  display: block;
}

@media (max-width: 768px) {
  .navbar .dropdown-menu {
    position: relative !important;
    display: block !important;
    transform: none !important;
    padding: 0 0 10px 0;
    border: none;
  }
}

The main menu navbar no longer requires JavaScript using input checkboxes combined with CSS, but this has not been extended to other dropdown menus yet.

<label for="navbar-menu-toggle" className="d-block d-md-none">
  <span className="icon ion-md-menu p-2" style={{fontSize: '1.5em'}}></span>
</label>
<input type="checkbox" id="navbar-menu-toggle" className="nojs-dropdown-toggle" aria-label="Menu"/>
<div className="nojs-dropdown-content"></div>
.nojs-dropdown-content {
  width: 100%;
}
.nojs-dropdown-toggle {
  display: none;
}
@media (max-width: 767px) {
  .nojs-dropdown-content {
     display: none;
  }
  .nojs-dropdown-toggle:checked + .nojs-dropdown-content {
    display: block;
  }
}

iaincollins added a commit that referenced this issue Jan 6, 2018
This is partly to address issues in #57 and #58.
iaincollins added a commit that referenced this issue Jan 12, 2018
Partly addresses issues in #57

* Dropdown menus in the nav menu on mobile now display correctly.
* The nav menu no longer requires JavaScript to be enabled to work and uses a pure CSS solution. I may prototype to extend this to other components and see if it’s a pull request the Reactstrap folks would be interested in.
iaincollins added a commit that referenced this issue Jan 12, 2018
This provides some support for issues rasied in #57 and #59.
iaincollins added a commit that referenced this issue Jan 12, 2018
This is partly to address issues in #57 and #58.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant