glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.68k stars 144 forks source link

Lost focus on livebook #1498

Closed drselump14 closed 1 year ago

drselump14 commented 1 year ago

What I tried to do

Try editing on Monaco editor on Livebook

What happened

Firenvim can't get the focus, and I need to click outside the frame and click the frame again to get the focus. It only happens on Livebook, Monaco editor on https://microsoft.github.io/monaco-editor/ works fine. Do you have any idea what's the issue? Or please give me some advice to debug the issue.

ezgif com-gif-maker

glacambre commented 1 year ago

Open the firefox debugger, find the Firenvim sources, open the file named FirenvimElement.ts and place a breakpoint on the first line of the constructor and then trigger Firenvim:

20230202_07h26m20s_grim

When hovering your mouse over elem, you will know what element Firenvim is attaching to. You need to figure out a unique CSS selector for this element (if you're lucky you can use the element's #id, otherwise you'll have to compute a path using parents and CSS classes), and then use this selector as described in Configuring what elements Firenvim should appear on.

drselump14 commented 1 year ago

@glacambre Thanks a lot, really appreciate the help

drselump14 commented 1 year ago

Looks like it's some compatibility issue with the livebook javascript code (https://github.com/livebook-dev/livebook/issues/1681) . So I will close this issue. Thanks for your help

glacambre commented 1 year ago

Oh, looks like I had completely misunderstood your issue, sorry about that. Indeed, I don't think Firenvim can do much more here.