creativetimofficial / ct-material-kit-pro-react

React version of Material Kit Pro
39 stars 12 forks source link

NavPill Animation #26

Closed eleventhaus closed 5 years ago

eleventhaus commented 5 years ago

!!! IF YOU DO NOT USE THIS ISSUES TEAMPLATE, YOUR ISSUE IS LIABLE TO BEING IGNORED BY US

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

When using navpills, there should be an option to re-render content without showing an animation on selecting tabs - like the angular version of Material Kit Pro

Current Behavior

Animation occurs

Failure Information (for bugs)

none

Steps to Reproduce

use navpills and navigate between tabs

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

einazare commented 5 years ago

Hello there @eleventhaus,

Thank you for your interest in working with our products. If you do not want to have animation on NavPills, go inside and change (lines 84-98):

<div className={classes.contentWrapper}>
        <SwipeableViews
          axis={direction === "rtl" ? "x-reverse" : "x"}
          index={this.state.active}
          onChangeIndex={this.handleChangeIndex}
        >
          {tabs.map((prop, key) => {
            return (
              <div className={classes.tabContent} key={key}>
                {prop.tabContent}
              </div>
            );
          })}
        </SwipeableViews>
      </div>

with

<div className={classes.contentWrapper}>
        {tabs.map((prop, key) => {
          if (key === this.state.active) {
            return (
              <div className={classes.tabContent} key={key}>
                {prop.tabContent}
              </div>
            );
          }
          return null;
        })}
      </div>

I'll speak with the board if this is something we should add on our product as well, for our next updates.

Best, Manu

eleventhaus commented 5 years ago

TY

eleventhaus commented 5 years ago

Also, to note, when using NavPills (without implementing the fix above to remove animation) the shadow on the card elements is cut off by the gridcontainer. Something to consider with regards to styling.

Default NavPills screen shot 2019-01-09 at 2 16 22 pm

NavPills without animation screen shot 2019-01-09 at 2 16 38 pm

einazare commented 5 years ago

Hello again, @eleventhaus

Thank you for sharing this with us. We'll see what we can do, in our next updates.

Best, Manu