Exit annotation editing mode when user leaves dashboard
parent
60c304cf6a
commit
bd1df4ba87
|
@ -28,6 +28,8 @@ import {
|
|||
hideCellEditorOverlay,
|
||||
} from 'src/dashboards/actions/cellEditorOverlay'
|
||||
|
||||
import {dismissEditingAnnotation} from 'src/shared/actions/annotations'
|
||||
|
||||
import {
|
||||
setAutoRefresh,
|
||||
templateControlBarVisibilityToggled as templateControlBarVisibilityToggledAction,
|
||||
|
@ -109,6 +111,7 @@ class DashboardPage extends Component {
|
|||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('resize', this.handleWindowResize, true)
|
||||
this.props.handleDismissEditingAnnotation()
|
||||
}
|
||||
|
||||
inView = cell => {
|
||||
|
@ -511,6 +514,7 @@ DashboardPage.propTypes = {
|
|||
getAnnotationsAsync: func.isRequired,
|
||||
handleShowCellEditorOverlay: func.isRequired,
|
||||
handleHideCellEditorOverlay: func.isRequired,
|
||||
handleDismissEditingAnnotation: func.isRequired,
|
||||
selectedCell: shape({}),
|
||||
thresholdsListType: string.isRequired,
|
||||
thresholdsListColors: arrayOf(shape({}).isRequired).isRequired,
|
||||
|
@ -587,6 +591,10 @@ const mapDispatchToProps = dispatch => ({
|
|||
hideCellEditorOverlay,
|
||||
dispatch
|
||||
),
|
||||
handleDismissEditingAnnotation: bindActionCreators(
|
||||
dismissEditingAnnotation,
|
||||
dispatch
|
||||
),
|
||||
})
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(
|
||||
|
|
Loading…
Reference in New Issue