diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1968d779..35c09f4c34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Fixed +- [#2589](https://github.com/plotly/dash/pull/2589) CSS for input elements not scoped to Dash application + +## Changed + - [#2593](https://github.com/plotly/dash/pull/2593) dcc.Input accepts a number for its debounce argument ## [2.11.1] - 2023-06-29 diff --git a/components/dash-core-components/src/components/Input.react.js b/components/dash-core-components/src/components/Input.react.js index 6f362215e3..62d3834b79 100644 --- a/components/dash-core-components/src/components/Input.react.js +++ b/components/dash-core-components/src/components/Input.react.js @@ -71,11 +71,14 @@ export default class Input extends PureComponent { const valprops = this.props.type === 'number' ? {} : {value: this.state.value}; const {loading_state} = this.props; + let {className} = this.props; + className = 'dash-input' + (className ? ` ${className}` : ''); return ( + + + {%app_entry%} + {%config%} + {%scripts%} + {%renderer%} + + + """ + + app.layout = html.Div( + className="test-input-css", + children=[dcc.Input(id="DashInput", required=True, className="unittest")], + ) + + dash_dcc.start_server(app) + + external_input = dash_dcc.find_element("#ExternalInput") + dash_input = dash_dcc.find_element(".unittest") + + external_outline_css = external_input.value_of_css_property("outline") + dash_outline_css = dash_input.value_of_css_property("outline") + + assert external_outline_css != dash_outline_css