-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scrollable tab set #443
Conversation
1a9024b
to
bba5c18
Compare
Is this WIP? |
baa11b1
to
38eeb06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me - just a couple of tiny comments
setActiveTab(index) | ||
|
||
if (onChangeCallback) { | ||
onChangeCallback(activeTab, title) | ||
onChangeCallback(index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was already here before and it's annoyingly a breaking change but maybe we could lose the word 'callback' and it could become onChange
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is a task here to carry out ahead of the v2.0.0 release - we could make our interfaces more consistent across the entire library.
} | ||
} | ||
|
||
const headerClassNames = classNames('rn-tab-set__head', { | ||
'is-scrollable': scrollable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just add this stateful class in once, at the root of the component?
itemsRef.current = itemsRef.current.slice(0, items.length) | ||
}, [items]) | ||
|
||
function updateCurrentScrollToTab(change: (currentTab: number) => number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely bit of inversion of control :)
70c8ba7
to
b39650e
Compare
Related issue
#225
Overview
Adding a scrollable tab set component
Reason
When there are a large number of tabs then these need to be scrolled through.
Work carried out
Screenshot
Developer notes
Still to do: