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

Fix tab disabled issue #568

Merged
merged 3 commits into from Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,8 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Ability to add tooltips to `Slider` and `RangeSlider`, which can be visible always or on hover. Tooltips also take a position argument. [#564](https://github.com/plotly/dash-core-components/pull/564)

### Fixed
- Fixed `min_date_allowed` and `max_date_allowed` bug in `DatePickerRange` [#551]https://github.com/plotly/dash-core-components/issues/551)
- Fixed `min_date_allowed` and `max_date_allowed` bug in `DatePickerRange` [#551](https://github.com/plotly/dash-core-components/issues/551)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hah cc @wbrgss I thought you already fixed this, bad rebase in #564?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought I fixed it, must be.

- Fixed unwanted `resize()` calls on unmounted `Graph`s [#534](https://github.com/plotly/dash-core-components/issues/534)
- Fixed `tab--disabled` CSS class issue in `Tab` component with custom styling
zoncrd marked this conversation as resolved.
Show resolved Hide resolved

### Changed
- Changed `dcc.Checklist` prop `values` to `value`, to match all the other input components [#558](https://github.com/plotly/dash-core-components/pull/558). Also improved prop types for `Dropdown` and `RadioItems` `value` props to consistently accept both strings and numbers.
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tabs.react.js
Expand Up @@ -33,7 +33,7 @@ const EnhancedTab = ({
}
let tabClassName = `tab ${className || ''}`;
if (disabled) {
tabClassName += `tab--disabled ${disabled_className || ''}`;
tabClassName += ` tab--disabled ${disabled_className || ''}`;
}
if (selected) {
tabClassName += ` tab--selected ${selectedClassName || ''}`;
Expand Down
4 changes: 4 additions & 0 deletions test/assets/testing.css
Expand Up @@ -2,3 +2,7 @@
width: 420px;
border-color: hotpink;
}

.test-custom-tab {
font-weight: bold;
}
20 changes: 20 additions & 0 deletions test/test_integration.py
Expand Up @@ -2406,6 +2406,26 @@ def snapshot(self, name):
# )
# )
#
def test_disabled_tab(self):
app = dash.Dash(__name__)
app.layout = html.Div([
html.H1("Dash Tabs component with disabled tab demo"),
dcc.Tabs(id="tabs-example", value='tab-2', children=[
dcc.Tab(label="Disabled Tab", value="tab-1", id="tab-1", className="test-custom-tab", disabled=True),
dcc.Tab(label="Active Tab", value="tab-2", id="tab-2", className="test-custom-tab"),
]),
html.Div(id="tabs-content-example"),
])
self.startServer(app=app)

WebDriverWait(self.driver, TIMEOUT).until(
EC.element_to_be_clickable((By.ID, "tab-2"))
)

WebDriverWait(self.driver, TIMEOUT).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, ".tab--disabled"))
)

def test_unmounted_graph_resize(self):
app = dash.Dash(__name__)

Expand Down