Skip to content
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

Tabs behavior when activeKey is null #1227

Closed
taion opened this issue Aug 26, 2015 · 2 comments · Fixed by #1244
Closed

Tabs behavior when activeKey is null #1227

taion opened this issue Aug 26, 2015 · 2 comments · Fixed by #1244

Comments

@taion
Copy link
Member

taion commented Aug 26, 2015

We currently treat null and undefined identically for deciding whether a Tabs component is controlled: https://github.com/react-bootstrap/react-bootstrap/blob/v0.25.0/src/Tabs.js#L196

Is this what we want, or should we interpret null as "controlled, but nothing selected"?

@jquense
Copy link
Member

jquense commented Aug 27, 2015

I tend to prefer letting null indicate no value, vs uncontrolled. react inputs treat null the same as undefined but that works because value is a ultimately a string, so you can use '' for "empty". Most components that will be uncontrolled won't have that luxury so null is the only good option for an explicit empty value. All that to say thats why I went with allowing null in uncontrollable

@taion
Copy link
Member Author

taion commented Aug 27, 2015

Oh, we should just use uncontrollable here. But as a quick patch, seems like we should make that check be

this.props.activeKey !== undefined

then.

jquense added a commit that referenced this issue Aug 28, 2015
AlexKVal pushed a commit to AlexKVal/react-bootstrap that referenced this issue Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants