Skip to content

Commit

Permalink
fix(dashboard): support input undo when editing chart title (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ authored and shcoderAlex committed Feb 7, 2022
1 parent 147656c commit 8dd5adb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8dd5adb

Please sign in to comment.