From 0ea7d9658513fb13952bcc778d61c25f35bc4e42 Mon Sep 17 00:00:00 2001 From: Ryan Marren Date: Mon, 13 Aug 2018 19:38:20 -0400 Subject: [PATCH] Fix #66 --- CHANGELOG.md | 4 ++++ dash_renderer/version.py | 2 +- src/reducers/reducer.js | 6 ++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77bfd60..4c76071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.13.3] - 2018-08-13 +### Fixed +- Fix a bug in the ON_PROP_CHANGE callback where history was not correctly set when acting on more than one component. In particular, the 'undo' button should now work as expected. Fixes [#66](https://github.com/plotly/dash-renderer/issues/66). + ## [0.13.2] - 2018-07-24 ### Fixed - Attempting to render a `Boolean` value to the page no longer crashes the app. diff --git a/dash_renderer/version.py b/dash_renderer/version.py index deea98b..1139861 100644 --- a/dash_renderer/version.py +++ b/dash_renderer/version.py @@ -1 +1 @@ -__version__ = '0.13.1' +__version__ = '0.13.2' diff --git a/src/reducers/reducer.js b/src/reducers/reducer.js index 33ca050..d7cb373 100644 --- a/src/reducers/reducer.js +++ b/src/reducers/reducer.js @@ -49,9 +49,7 @@ function getInputHistoryState(itempath, props, state) { function recordHistory(reducer) { return function (state, action) { // Record initial state - if (action.type === 'ON_PROP_CHANGE' && - R.isEmpty(state.history.present) - ) { + if (action.type === 'ON_PROP_CHANGE') { const {itempath, props} = action.payload; const historyEntry = getInputHistoryState(itempath, props, state); if (historyEntry && !R.isEmpty(historyEntry.props)) { @@ -75,7 +73,7 @@ function recordHistory(reducer) { nextState.history = { past: [ ...nextState.history.past, - nextState.history.present + state.history.present ], present: historyEntry, future: []