Right-click inside a Froala editor and you get the browser’s menu. Spell check suggestions, Inspect, Translate to English. Nothing to do with the document you’re editing.
That’s deliberate. Froala reckons right-clicking to edit a table in a browser is wrong and that people want their native menu left alone. The only setting they ship is disableRightClick, which kills the browser menu inside the editor and puts nothing in its place.
Word does it. So does Google Docs, Notion, and whatever IDE you’ve got open right now. People right-click a table cell looking for Insert Row Above, get a spell checker, and file a bug against your app.
So I built one. It’s called RangeMenu and it’s live at rangemenu.com.
Menu items are just Froala commands. Put 'bold', 'insertLink', 'formatUL' or anything else registered in your build into the items array and it turns up with that command’s own behaviour and undo handling. Nothing to keep in sync when you add or drop a plugin. If a plugin isn’t loaded, its item disappears instead of sitting there dead.
Right-click a table cell and you get row and column actions. An image gets image actions, a link gets link actions. Your own items nest as deep as you want, take a disabled predicate, show a shortcut hint, and get wrapped in a single undo snapshot so one menu click is one Ctrl+Z.
Selection is where I lost the most time. Right-clicking an editor that doesn’t have focus leaves the browser selection sitting somewhere else, so Insert Row Above has no idea which row you meant. RangeMenu puts the caret under the pointer first, with caretRangeFromPoint and a caretPositionFromPoint fallback for browsers that only have the newer one.
Right-click inside text you’ve already highlighted and the selection stays put, because you wanted Cut or Copy. The menu swallows its own mousedown too, so focus never leaves the editing area and the selection survives you walking through a submenu with the arrow keys.
Paste is the one item browsers can ruin. It uses the async Clipboard API where permission is granted and falls back to plain text. If the browser refuses outright, the item does nothing and logs a warning saying so.
Styles inject into whichever root the editor lives in, document or shadow root, so there’s no stylesheet to link and shadow DOM works without you doing anything. Colours, radius and font are custom properties on .rgm, and the theme follows the operating system if you want it to. Framed editors, inline editors, twenty editors on one page, all fine. Each gets its own config, and opening one closes the rest.
It ships as ESM, CJS and a script tag build with TypeScript definitions, for Froala v4 and v5. React, Vue and Angular wrappers work as-is, because registration hooks the FroalaEditor constructor rather than any particular wrapper.
If you’ve been searching for a Froala context menu and landing on an old GitHub issue and a Stack Overflow answer telling you to bind your own mousedown handler, I got sick of writing that handler too.
Twenty bucks, once, unlimited projects and domains, every 1.x update included. You still need your own Froala licence, that part isn’t mine to sell.
There’s a live editor on the homepage. Go and right-click it.