Add ESC btn to toolbar to quickly exit formatting (#1283)

* Add ESC btn to toolbar to quickly exit formatting

* add horizontal scroll to toolbar item

* make editor toolbar usable in touch device

* fix editor hotkeys not working in window

* remove unused import
This commit is contained in:
Ajay Bura
2023-06-16 11:09:09 +10:00
committed by GitHub
parent 2883b4c35b
commit bc5e7445d9
7 changed files with 210 additions and 108 deletions

View File

@@ -32,7 +32,9 @@ export const toggleMark = (editor: Editor, format: MarkType) => {
};
export const removeAllMark = (editor: Editor) => {
ALL_MARK_TYPE.forEach((mark) => Editor.removeMark(editor, mark));
ALL_MARK_TYPE.forEach((mark) => {
if (isMarkActive(editor, mark)) Editor.removeMark(editor, mark);
});
};
export const isBlockActive = (editor: Editor, format: BlockType) => {