Skip to content

Commit

Permalink
keyboard shortcut handler for capitalize
Browse files Browse the repository at this point in the history
  • Loading branch information
Shopiley committed Dec 12, 2024
1 parent 8469d94 commit 44f2078
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
UpdateFontSizeType,
} from '../ToolbarPlugin/utils';
import {
isCapitalize,
isCenterAlign,
isClearFormatting,
isDecreaseFontSize,
Expand Down Expand Up @@ -104,6 +105,9 @@ export default function ShortcutsPlugin({
} else if (isUppercase(event)) {
event.preventDefault();
editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'uppercase');
} else if (isCapitalize(event)) {
event.preventDefault();
editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'capitalize');
} else if (isIndent(event)) {
event.preventDefault();
editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
Expand Down

0 comments on commit 44f2078

Please sign in to comment.