You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason that I ignore, after upgrading version (I guess that was what happen), I stop getting the event in the handler of an extra key specified in keymap (and I do need to stop event propagation):
// Define custom key bindingsconstmyKeymap=[{key: "Ctrl-s",run: (view)=>{console.log("Save triggered!");// Action to be taken when "Ctrl-s" is pressedreturntrue;// Return true to indicate the key was successfully handled},preventDefault: true,// Prevents the default browser action for this key},{key: "Ctrl-b",run: (view)=>{console.log("Bold formatting triggered!");// Action to be taken when "Ctrl-b" is pressedreturntrue;// Return true to indicate the key was successfully handled},preventDefault: true,// Prevents the default browser action for this key},];<CodeMirrorextensions={[...myKeymap]}// Add keymap as an extension in the editor setup/>
@guillermoamaral I’m not sure where the issue is, so here’s an example for your reference.
The issue was that my hanlders (e.g., enterPressed = (editor, event)), expected (and received in a previous version) the event as a second parameter (with which they did things like event.preventDefault()). For some reason that stop happening and my handlers broke because event argument was undefined.
I changed my code to use the property preventDefault and remove event argument from my handlers.
Hello sr!
For some reason that I ignore, after upgrading version (I guess that was what happen), I stop getting the event in the handler of an extra key specified in keymap (and I do need to stop event propagation):
Any help is wellcome. Thanks!
The text was updated successfully, but these errors were encountered: