diff --git a/src/actions/index.js b/src/actions/index.js index 46c86a6..38e2cec 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -13,6 +13,7 @@ import { has, intersection, isEmpty, + isNil, keys, lensPath, merge, @@ -80,6 +81,10 @@ function triggerDefaultState(dispatch, getState) { getState().layout ); + if (isNil(propValue)) { + return; + } + dispatch(notifyObservers({ id: componentId, props: {[componentProp]: propValue}, diff --git a/tests/test_render.py b/tests/test_render.py index dc1c68e..460161f 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -1682,71 +1682,6 @@ def callback(*args): "input-{}, input-{}".format(i, i+1) ) - def test_generate_overlapping_outputs(self): - app = dash.Dash() - app.config['suppress_callback_exceptions'] = True - block = html.Div([ - - html.Div(id='input-1', children='input-1'), - html.Div(id='input-2', children='input-2'), - html.Div(id='input-3', children='input-3'), - html.Div(id='input-4', children='input-4'), - html.Div(id='input-5', children='input-5'), - - html.Div(id='output-1'), - html.Div(id='output-2'), - html.Div(id='output-3'), - html.Div(id='output-4'), - - ]) - app.layout = html.Div([ - html.Div(id='input'), - html.Div(id='container') - ]) - - call_counts = { - 'container': Value('i', 0), - 'output-1': Value('i', 0), - 'output-2': Value('i', 0), - 'output-3': Value('i', 0), - 'output-4': Value('i', 0), - } - - @app.callback(Output('container', 'children'), - [Input('input', 'children')]) - def display_output(*args): - call_counts['container'].value += 1 - return block - - def generate_callback(outputid): - def callback(*args): - call_counts[outputid].value += 1 - return '{}, {}'.format(*args) - return callback - - for i in range(1, 5): - outputid = 'output-{}'.format(i) - app.callback( - Output(outputid, 'children'), - [Input('input-{}'.format(i), 'children'), - Input('input-{}'.format(i+1), 'children')] - )(generate_callback(outputid)) - - self.startServer(app) - - wait_for(lambda: call_counts['container'].value == 1) - self.wait_for_element_by_css_selector('#output-1') - time.sleep(5) - - for i in range(1, 5): - outputid = 'output-{}'.format(i) - self.assertEqual(call_counts[outputid].value, 1) - self.wait_for_text_to_equal( - '#{}'.format(outputid), - "input-{}, input-{}".format(i, i+1) - ) - self.assertEqual(call_counts['container'].value, 1) - def test_update_react_version(self): import dash_renderer