rilyu/teaset

Segmented View navigation with other button

Opened this issue · 2 comments

Hi all, i don't have no idea to make navigation to other segmented sheet with other button. So the case is i have button confirmation in sheet 1, when i click that button i want navigating to sheet 2 anyway to implement that case?

i found the same question

now i found how to fix it. the lib has no bug,but the example has a little question

example/views/SegmentedBarExample.js :

onCarouselChange(index) {
        // index != this.state.activeIndex && this.setState({activeIndex: index});// bug code
        //i change to:
        if (index != this.state.activeIndex) {
            if (this.refs.segmentedbar) {
                this.refs.segmentedbar.activeIndex = index;//this line sync segmentbar and carousel
            }
        }
    }

then add this ref

 <SegmentedBar
          ........
          ref='segmentedbar'
          ........
        >

i test, it works, but the anim was wrong。may be extends the class SegmentedBar is a good way.