timomeh / react-native-material-bottom-navigation

💅🔧👌 a beautiful, customizable and easy-to-use material design bottom navigation for react-native
MIT License
709 stars 127 forks source link

Animation problem that is tilting #32

Closed Angelk90 closed 6 years ago

Angelk90 commented 7 years ago

I click on a button, realizing I mistakenly click on click on another and Instead I wanted to click on the last, then click on the last one.

Tab 1 (activated) Click on tab 2 And immediately click on tab 3

I get a strange, repetitive effect.

Then, whenever I click on another tab other than tab 3 that was the last selected (then the active one) repeats the odd sequence that occurred at the beginning and end of the new tab that was selected.

Even the text sometimes disappears.

At the moment I'm not using anything, so standalone.

Code:

      <BottomNavigation
        ActiveTab this.state.activeTab = {}
        LabelColor = "white"
        rippleColor = "white"
        backgroundColor = "# 006ACC"
        Style = {height: 56, height: 8, position: 'absolute', left: 0, bottom: 0, right: 0}}
        onTabChange this.handleTabChange = {}
      >
        <Tab
          label = "Home"
          Icon = {<Icon size = {24} color = "white" name = "home" />}
        />
        <Tab
          label = "Music"
          Icon = {<Icon size = {24} color = "white" name = "music-note" />}
        />
        <Tab
          label = "Add"
          Icon = {<Icon size = {24} color = "white" name = "add-box" />}
        />
        <Tab
          label = "Books"
          Icon = {<Icon size = {24} color = "white" name = "book" />}
        />
        <Tab
          label = "Profile"
          Icon = {<Icon size = {24} color = "white" name = "account-circle" />}
        />
      </ BottomNavigation>

Image: https://i.giphy.com/3o7buaqyj435uZMhig.gif

timomeh commented 7 years ago

Thanks for reporting. I have to test around a bit, but I know I think where the problem is. It's a bit related to #6. I have to check if I'm going to fix both together or if those are separate things. I'll get to it if I have some spare time.

Note: That Code Snippet can't work. Please use working code snippets and/or real examples in the future.

wildseansy commented 6 years ago

I get this problem too. I don't think you need a super complicated example to repro. Just need to test by pressing sufficiently fast. For me I had to use a real device (not emulator) to press buttons fast with two fingers. The tab selection sequence then repeats forever.

Angelk90 commented 6 years ago

@wildseansy: How did you solve it?

wildseansy commented 6 years ago

I forked and am using my fork for now. See PR: https://github.com/timomeh/react-native-material-bottom-navigation/pull/55/files

  //in package.json
    "react-native-material-bottom-navigation": "github:wildseansy/react-native-material-bottom-navigation",
Angelk90 commented 6 years ago

@wildseansy: Does not he give you any trouble like that?

wildseansy commented 6 years ago

Yeah, unless you have a REALLY slow device, it fixes it. Basically the device has to have a > .5 sec response time for each button click to still break. It's not out of the question, but pretty unlikely. It depends on your app's complexity/performance and the device hardware.

Angelk90 commented 6 years ago

@wildseansy: But the continuous loop repeats of the same buttons, I do not understand why it was happening. Then they were as if they were stored and never ended. :) I can ask if you can post a gif or video to see what result You get it.

wildseansy commented 6 years ago

Yeah, that is what I also witnessed. This fixes it for me, but doesn't solve the root issue.

Angelk90 commented 6 years ago

@wildseansy:Which of you would be the main problem?

Angelk90 commented 6 years ago

@wildseansy: Can I ask you something? since you've solved the problem.