From 8dd5adb8e3375c3500e2c17dd62b2580bf8eb288 Mon Sep 17 00:00:00 2001 From: Stephen Liu <750188453@qq.com> Date: Thu, 27 Jan 2022 14:53:46 +0800 Subject: [PATCH] fix(dashboard): support input undo when editing chart title (#18137) --- .../src/dashboard/components/UndoRedoKeyListeners/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/dashboard/components/UndoRedoKeyListeners/index.jsx b/superset-frontend/src/dashboard/components/UndoRedoKeyListeners/index.jsx index a6160dd295d0d..532eec42f2250 100644 --- a/superset-frontend/src/dashboard/components/UndoRedoKeyListeners/index.jsx +++ b/superset-frontend/src/dashboard/components/UndoRedoKeyListeners/index.jsx @@ -45,8 +45,10 @@ class UndoRedoKeyListeners extends React.PureComponent { const isYChar = event.key === 'y' || event.keyCode === 89; const isEditingMarkdown = document && document.querySelector('.dashboard-markdown--editing'); + const isEditingTitle = + document && document.querySelector('.editable-title--editing'); - if (!isEditingMarkdown && (isZChar || isYChar)) { + if (!isEditingMarkdown && !isEditingTitle && (isZChar || isYChar)) { event.preventDefault(); const func = isZChar ? this.props.onUndo : this.props.onRedo; func();