Playground hijacks Cmd+L keyboard shortcut

Cmd+L is probably the browser (Chrome) shortcut I use the most so it’s driving me crazy that it doesn’t work on the Playground page!

Can we disable or change the shortcut to something else? Perhaps Cmd+Shift+L?

I think this one is for @RaananW.

Cmd+L will work if you click on the canvas and then press it. it doesn’t work when you edit, since what we have integrated in the playground is the monaco editor, which captures all of your keystrokes and uses them for the editor itself. Same goes to the tab key :slight_smile:

Well, the nice thing with Cmd+L is that it always works, on whatever element is focused. So Monaco breaks this, and it’s super annoying.

Seems like a good shortcut api for Monaco is on the backlog but it might still be possible according to

Yes, this is exactly my point. And this is why I mentioned the tab key. You can argue that When pressing tab inside the editor you don’t move to the next focusable element but rather input a tab in the editor. ( even better - it is not even a tab! it’s 4 spaces) or when pressing Cmd+S the playground saves and the default save dialog of the browser doesn’t show up. Cmd+L is a reserved shortcut for monaco, and since we want to enable the full monaco experience, we haven’t overridden any shortcuts there.

Sure, an editor without a working tab key would be crappy. The Cmd+S browser shortcut you can live without I agree with that. However, Cmd+L, not so much.

So to be pragmatic, the best balance would be to keep hijacking tab to make a nice editor, but let Cmd+L off the hook to make a nice browser.

I actually use ctrl-l quite a lot when i develop. very helpful when deleting or duplicating lines.

I don’t mean to argue or to convince you otherwise :slight_smile: and I am sorry if it sounds like this. But we won’t override default behavior of the editor, mainly because we want to give the full monaco experience to the dev using our playground.

Sorry, What does cmd+L do? (not sure if it’s different…)

Ctrl+L just focuses url bar, does not seem like such a big deal…

There are some keybinds that javascript can’t change or disable, maybe you can use those :slight_smile:
some related;
Ctrl + W, closes current tab
Ctrl + T, opens new tab
Ctrl + N, opens new tab in new window

Yeah, it focuses the url bar and something people use a lot to quickly navigate the internets.

@aWeirdo, those shortcuts are also nice, but when you want to stay on the same domain Cmd+L is nicer :slight_smile:

@RaananW, sure, not saying the full Monaco experience is bad, just that it’s unfortunate that they picked Cmd+L. It would be better with Cmd+Shift+L which is not a default browser shortcut. Never used Monaco before though. I’m sure most users are more used to Chrome than Monaco so making them learn another shortcut shouldn’t be so bad.

Let’s agree to disagree :slight_smile:
This won’t change any time soon

Note that Cmd+L in editors is a common shortcut, it’s not a Monaco specific thing: Visual Studio (code or not), Sublime text, Atom are using this shortcut to select a line and I’m sure there are a lot others.

Strange, in my Visual Studio Code it’s not doing anything.

I hope there comes a time when browsers get better settings for this. It would be nice to say “this shortcut should never be overridden by a web application.”