Fix ctrl-m shortcut for Windows and shift-del shortcut for Linux
This commit is contained in:
parent
1c5450122f
commit
3946b5aec6
1 changed files with 13 additions and 1 deletions
|
@ -16,7 +16,7 @@ import {
|
||||||
} from 'draft-js';
|
} from 'draft-js';
|
||||||
import Measure, { ContentRect } from 'react-measure';
|
import Measure, { ContentRect } from 'react-measure';
|
||||||
import { Manager, Popper, Reference } from 'react-popper';
|
import { Manager, Popper, Reference } from 'react-popper';
|
||||||
import { head, noop, trimEnd } from 'lodash';
|
import { get, head, noop, trimEnd } from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import emojiRegex from 'emoji-regex';
|
import emojiRegex from 'emoji-regex';
|
||||||
import { Emoji } from './emoji/Emoji';
|
import { Emoji } from './emoji/Emoji';
|
||||||
|
@ -548,6 +548,18 @@ export const CompositionInput = ({
|
||||||
return 'prev-emoji';
|
return 'prev-emoji';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get rid of default draft.js ctrl-m binding which interferes with Windows minimize
|
||||||
|
if (e.key === 'm' && e.ctrlKey) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (get(window, 'platform') === 'linux') {
|
||||||
|
// Get rid of default draft.js shift-del binding which interferes with Linux cut
|
||||||
|
if (e.key === 'Delete' && e.shiftKey) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return getDefaultKeyBinding(e);
|
return getDefaultKeyBinding(e);
|
||||||
},
|
},
|
||||||
[emojiResults]
|
[emojiResults]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue