Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created December 22, 2023 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/ab294228a9faf88a64cfe7c06941fe66 to your computer and use it in GitHub Desktop.
Save bjoerntx/ab294228a9faf88a64cfe7c06941fe66 to your computer and use it in GitHub Desktop.
// remove the "Insert" menu item
TXTextControl.addEventListener("contextMenuOpening", e => {
// check if e.items contains an entry where property text == "Insert"
const index = e.items.findIndex(i => i.text === "Insert");
// if so, remove it
if (index > -1) {
e.items.splice(index, 1);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment