Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: execCommand functions can be called directly

ammarahm-ed5253116ce7ee
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/item.js b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
index 9a5bc0c02..c8e829ad6 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/item.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
@@ -319,7 +319,12 @@ const ToolbarItem = ({
} else if (value || value === '') {
formatSelection(execCommands[format](value));
} else {
- formatSelection(execCommands[format]);
+ if (typeof execCommands[format] === "function") {
+ formatSelection(execCommands[format]());
+ } else {
+ formatSelection(execCommands[format]);
+ }
+
}
focusEditor(format);