Skip to content

Commit

Permalink
Fix: lose element selection on page flip
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Feb 27, 2019
1 parent 2028fdf commit f91b840
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x-pack/plugins/canvas/public/state/middleware/aeroelastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../actions/elements';
import { restoreHistory } from '../actions/history';
import { selectElement } from '../actions/transient';
import { addPage, removePage, duplicatePage } from '../actions/pages';
import { addPage, removePage, duplicatePage, gotoPage } from '../actions/pages';
import { appReady } from '../actions/app';
import { setWorkpad } from '../actions/workpad';
import { getNodes, getPages, getSelectedPage, getSelectedElement } from '../selectors/workpad';
Expand Down Expand Up @@ -59,6 +59,8 @@ const aeroelasticConfiguration = {

const isGroupId = id => id.startsWith(aeroelasticConfiguration.groupName);

const pageChangerActions = [gotoPage.toString(), duplicatePage.toString(), addPage.toString()];

/**
* elementToShape
*
Expand Down Expand Up @@ -320,6 +322,10 @@ export const aeroelastic = ({ dispatch, getState }) => {
aero.removeStore(action.payload);
}

if (pageChangerActions.indexOf(action.type) >= 0) {
unselectShape(prevPage);
}

next(action);

switch (action.type) {
Expand Down

0 comments on commit f91b840

Please sign in to comment.