-
-
Notifications
You must be signed in to change notification settings - Fork 145
Conversation
It looks like this is the issue with the committed bundle files: https://unix.stackexchange.com/questions/32001/what-is-m-and-how-do-i-get-rid-of-it |
Any ETA on new version merging those fixes? |
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.
Should have rebased instead of regenerating all the components. Fix the indentation.
src/components/Tabs.react.js
Outdated
@@ -124,53 +124,62 @@ export default class Tabs extends Component { | |||
} | |||
render() { |
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.
The indentation is 2 space while the rest of the components is 4 spaces.
test/test_integration.py
Outdated
@@ -456,6 +456,20 @@ def render_content(tab): | |||
time.sleep(2) | |||
self.assertEqual(tabs_content.text, 'Test content 1') | |||
|
|||
|
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.
⚡️ Only one space between methods in classes.
test/test_integration.py
Outdated
@@ -456,6 +456,20 @@ def render_content(tab): | |||
time.sleep(2) | |||
self.assertEqual(tabs_content.text, 'Test content 1') | |||
|
|||
|
|||
def test_tabs_with_children_undefined(self): |
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 think this test could be improved, right now it doesn't do much. Maybe add the tabs in a callback triggered by a button ?
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.
This test tests if a Tabs component still renders even if children
is undefined. Previously, if children
was not set, it would break, thus throwing an error, and thus failing this test. This PR fixes #265 as mentioned above.
src/components/Tabs.react.js
Outdated
|
||
const amountOfTabs = this.props.children.length | ||
const amountOfTabs = this.props.children.length |
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.
Missing ;
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.
+1, technically we should be using semicolons.
Many more missing -- too many to mention in a review. I recommend adding
/*eslint semi: ["error", "always"]*/
to the top of this file and linting again to catch them
@T4rk1n What good would rebasing have done in this case? I'm seeing a change in end-of-line characters, when I rebuild the Tabs component it automatically rebuild all of the other components because the end-of-line characters where different (see link https://unix.stackexchange.com/questions/32001/what-is-m-and-how-do-i-get-rid-of-it) |
@valentijnnieman Your right. it put the ^M in the docstrings, probably from when I generated the classes, git doesn't replace the newline in strings automatically. |
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.
Recommending some more style changes 🐄
Repeating my 'outdated' comment:
Technically we should be using semicolons.
Many more missing -- too many to mention in a review. I recommend adding
/*eslint semi: ["error", "always"]*/
to the top of this file and linting again to catch them
src/components/Tabs.react.js
Outdated
|
||
const amountOfTabs = this.props.children.length | ||
const amountOfTabs = this.props.children.length |
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.
+1, technically we should be using semicolons.
Many more missing -- too many to mention in a review. I recommend adding
/*eslint semi: ["error", "always"]*/
to the top of this file and linting again to catch them
src/components/Tabs.react.js
Outdated
this.props.children = [this.props.children]; | ||
} | ||
if(this.props.children) { | ||
if (!Array.isArray(this.props.children)) { |
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.
Some inconsistency here (R.is(Array, foo)
is used above here). Apparently there's also the undocumented R.isArray
.
@wbrgss That's why we have |
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.
💃 from me
💃 |
Hi! I deployed a Dash app some weeks ago and everything went okay and worked properly with the tabs, but now I ran the exactly the same code, but now I have to change the tabs whenever I want to update the callback. Do you know what might be happening? Does this PR was supposed to fix this? I`ve looked on #265 also but it didn't solve :( My layout code is:
|
This fixes the bug where the
Tabs
component breaks if nochildren
props are set. This should fix #265 too.It also fixes the bug where the 2nd tab was selected by default - #262
(Sorry, I had some trouble with my commits, it looks a bit wonky)