Keyboard Shortcut to Toggle Design and Code Views

I really wish there was a keyboard shortcut to toggle between Design view and Code view while working on a Form. It’d change my life and probably save me from carpal tunnel syndrome too. :slightly_smiling_face:

3 Likes

It’s a sensible request. I have the same issue

what about this as a temprorary workaround
open up your dev tools console and paste in below

var design = $('[data-test-handle="design-mode-button"]')
var code = $('[data-test-handle="code-mode-button"]')
$("body").on("keydown", (e) => {
    if (e.altKey && e.shiftKey && e.which == 75) {
        if (design.hasClass('btn-default')) {
            design.click();
        } else {
            code.click();
        }
    }
});

now you have the keyboard shortcut alt + shift + k

2 Likes

@stucork - you’re a miracle worker. That works beautifully.

Anyone know of a Chrome extension that could run this everytime an app finishes loading? I tried User Javascript and CSS but I can’t get it to work with @stucork’s shortcut snippet. Or maybe there’s a javascript listener that I could use to run it at the right time (i.e., after everything’s loaded)?

couldn’t get that extension to work either - it ran fine but then didn’t seem to have access to trigger the click events.

Not perfect but you can add the code it to chrome devtools snippets:

1 Like

At least it wasn’t just me. Adding it to a snippets is a solid compromise, great suggestion - honestly, I didn’t even know snippets was a thing. Thanks a lot for your help!

1 Like

Closed as we’ve created a single thread for all the keyboard shortcut suggestions.

Keyboard shortcuts suggestions [ON-GOING]