materialize icon indicating copy to clipboard operation
materialize copied to clipboard

SideNav not coming into view

Open robcalcroft opened this issue 10 years ago • 9 comments

The overlay appears but the nav is still 105% off to the right, same with if I use {edge: 'left'}.

import React from 'react';
import Nav from 'components/Nav';
import './style.scss';

const links = (
  <div>
    <li><a href='http://github.com/robcalcroft/x'>About</a></li>
    <li><a href='x'>Help</a></li>
    <li><a href='#'>Logout</a></li>
  </div>
);

export default class Container extends React.Component {
  render() {
    return (
      <nav>
        <div className='nav-wrapper container--fluid'>
          <img src={require('assets/logo_horz_darkbg.png')} className='nav--logo' alt='x' />
          <ul className='right hide-on-med-and-down'>{links}</ul>
          <ul id='slide-out' className='side-nav'>{links}</ul>
          <a href='#' data-activates='slide-out' className='button-collapse right'>
            <span className='nav--mobile-menu'>Menu</span>
          </a>
        </div>
      </nav>
    );
  }
}

robcalcroft avatar Apr 02 '16 17:04 robcalcroft

+1

aquatix avatar Apr 03 '16 18:04 aquatix

+1 It was working fine with 0.97.5, but stopped with 0.97.6. Reverted back to 0.97.5.

ScOut3R avatar May 28 '16 17:05 ScOut3R

@ScOut3R Can you post your code that wasnt working?

acburst avatar May 28 '16 22:05 acburst

+1 - updated from 0.97.0 to 0.97.6 and the sidenav on narrow screens does not show. No code changes on the page, reverting to the old version gets things back to normal.

The side-nav element gets assigned a transform: translateX(0px); whereas with the old version it was left: 0px;. Adding the latter in the developer console leads to the menu being displayed.

goeddea avatar May 31 '16 12:05 goeddea

Same for me after update to 0.97.6, a left sidenav not show on narrow screens. Adding menu_id.css('left','0px'); to make it work :

if (options.edge === 'left') {
    dragTarget.css({width: '50%', right: 0, left: ''});
    menu_id.velocity({'translateX': [0, -1 * options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
    menu_id.css('left','0px');
}

Ehnix avatar Jun 12 '16 14:06 Ehnix

Any eta on when this will be fixed?

ghost avatar Jul 07 '16 02:07 ghost

@acburst I am sorry for the extremely late response. I've just checked this issue and it is still present for me with 0.97.7.

$('.document-button').sideNav({
        menuWidth: 300,
        edge: 'left',
        closeOnClick: true
      });
<ul id='slide-left' className='side-nav teal darken-2 white-text' >
                <li className='title'><h3>Documents</h3></li>
                <DocTypes
                    onFilterType={this.handleFilterType}
                />
                <SearchDocs
                    filterText={this.state.filterText}
                    onUserInput={this.handleUserInput}
                />
                <DocList
                    docs={this.state.docs}
                    filterText={this.state.filterText}
                    filterType={this.state.filterType}
                />
            </ul>

ScOut3R avatar Aug 11 '16 13:08 ScOut3R

Nevermind, by bad.

I had the following hidden in my code somewhere:

#slide-left {
  left: -300px;
}

#slide-right {
  right: -300px;
}

Removed everything started to work.

ScOut3R avatar Aug 12 '16 12:08 ScOut3R

edit: nm, working for me now!

gitdistill avatar Aug 15 '16 19:08 gitdistill