mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Fix: lose element selection on page flip * Fix: remove selection in Redux too (PR feedback from Joe)
This commit is contained in:
parent
10a2ef3618
commit
f64bcd75d7
1 changed files with 11 additions and 1 deletions
|
@ -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';
|
||||
|
@ -59,6 +59,8 @@ const aeroelasticConfiguration = {
|
|||
|
||||
const isGroupId = id => id.startsWith(aeroelasticConfiguration.groupName);
|
||||
|
||||
const pageChangerActions = [gotoPage.toString(), duplicatePage.toString(), addPage.toString()];
|
||||
|
||||
/**
|
||||
* elementToShape
|
||||
*
|
||||
|
@ -320,6 +322,14 @@ export const aeroelastic = ({ dispatch, getState }) => {
|
|||
aero.removeStore(action.payload);
|
||||
}
|
||||
|
||||
if (pageChangerActions.indexOf(action.type) >= 0) {
|
||||
if (getSelectedElement(getState())) {
|
||||
dispatch(selectElement(null)); // ensure sidebar etc. get updated; will update the layout engine too
|
||||
} else {
|
||||
unselectShape(prevPage); // deselect persistent groups as they're not currently selections in Redux
|
||||
}
|
||||
}
|
||||
|
||||
next(action);
|
||||
|
||||
switch (action.type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue