X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cc493b89840b48f40c2beaf626994724331aa196..abf8502a9a1f061f58586b966a4012674d9cb71e:/src/store/details-panel/details-panel-action.ts diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts index 2724a3e346..0f13286535 100644 --- a/src/store/details-panel/details-panel-action.ts +++ b/src/store/details-panel/details-panel-action.ts @@ -3,6 +3,9 @@ // SPDX-License-Identifier: AGPL-3.0 import { unionize, ofType, UnionOf } from '~/common/unionize'; +import { Dispatch } from 'redux'; + +export const SLIDE_TIMEOUT = 500; export const detailsPanelActions = unionize({ TOGGLE_DETAILS_PANEL: ofType<{}>(), @@ -13,6 +16,11 @@ export type DetailsPanelAction = UnionOf; export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAILS_PANEL(uuid); - - - +export const toggleDetailsPanel = () => (dispatch: Dispatch) => { + // because of material-ui issue resizing details panel breaks tabs. + // triggering window resize event fixes that. + setTimeout(() => { + window.dispatchEvent(new Event('resize')); + }, SLIDE_TIMEOUT); + dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); +};