I created a custom rule to prevent elements from being deleted.
It is based off of this code and this repo: vite-vue-bpmn-process/src/additional-modules/Rules/CustomRules.ts at ba2b936157e35af86fa4e1b628b41bafd7dd4bf5 · moon-studio/vite-vue-bpmn-process · GitHub
It works correctly as far as preventing the deletion. I want to provide feedback to the user when they attempt to delete something and cannot, and the problem is that the logic inside my custom rule is executed, not only when a user actually attempts to delete an element (wanted) but also when a user has just clicked/selected any element.
Is this supposed to happen? Currently I cannot figure out how to differentiate, inside my custom rule, whether a user is actually attempting to delete an element (with the DEL keyboard key) or if they just selected an element.
Would really appreciate some insight on how to execute something inside my rule ONLY when a user is actually attempting to delete an element with the keyboard.
Many thanks!