Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livebook cell won't give up the focus to firenvim #1681

Closed
drselump14 opened this issue Feb 2, 2023 · 5 comments
Closed

Livebook cell won't give up the focus to firenvim #1681

drselump14 opened this issue Feb 2, 2023 · 5 comments
Labels
area:frontend Related to UI/UX contributions welcome Ready to implement (contributions welcome)

Comments

@drselump14
Copy link
Contributor

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.14.2 otp 25
  • Operating system: MacOS Ventura
  • How have you started Livebook (mix phx.server, livebook CLI, Docker, etc): livebook CLI/Desktop
  • Livebook version (use git rev-parse HEAD if running with mix): 0.8.1
  • Browsers that reproduce this bug (the more the merrier): Firefox, Chrome
  • Include what is logged in the browser console: nothing
  • Include what is logged to the server console: nothing

Current behavior

Launch firenvim on the cell, but Firenvim doesn't get the focus, so then every event is still sent to livebook cell.
I need to click outside the frame and click the frame again to get the focus.
ezgif com-gif-maker

Expected behavior

Launch firenvim on the cell, the focus would be on firenvim and every event is sent to firenvim instance.

@josevalim
Copy link
Contributor

Thank you for the report. We will appreciate if someone can look into this issue and provide a fix. We are glad firenvim is an option but we have little bandwidth to prioritize this issue.

@drselump14
Copy link
Contributor Author

Hi, thanks a lot for the reply. I understand the situation. Is there any idea which livebook code I can start to look at to fix the issue?

@josevalim
Copy link
Contributor

@jonatanklosko would be the person to provide a pointer. But, just in case, did you check that the issue also does not happen in regular Monaco?

@jonatanklosko
Copy link
Member

In insert mode we always make sure the Monaco editor is focused:

liveEditor.onBlur(() => {
// Prevent from blurring unless the state changes. For example
// when we move cell using buttons the editor should keep focus
if (this.isFocused && this.insertMode) {
this.currentEditor().focus();
}
});

so the focus goes to the original editor.

@josevalim josevalim added contributions welcome Ready to implement (contributions welcome) area:frontend Related to UI/UX labels Feb 28, 2023
@josevalim
Copy link
Contributor

I will go ahead and close this. If someone wants to send a PR though, it is very welcome. We wouldn't mind special casing the focus logic to consider firenvim classes and act accordingly. It should be a small change in theory. :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend Related to UI/UX contributions welcome Ready to implement (contributions welcome)
Projects
None yet
Development

No branches or pull requests

3 participants