Code editor loses focus

I’ve noticed that the code window often loses focus, so I’m typing one second then I have to click back on the code window to continue.

One way to reproduce it is to press the escape key to remove the autocompleter. I’ve tried to capture this effect in this little gif, note I have to click back in the window to make the cursor return after removing the autocompleter :

code-cursor-vanish

This is recent (well, I’ve been away for a bit so recent to me).

I’m using Ubuntu 20.4, fully updated, Firefox 81.0.2 (64-bit)

edit - this doesn’t occur on Chrome.

It’s done this for as long as I can remember. Drives me nuts!

(Current workaround - type it in the ide in one long horrible line, ctrl-e into neovim, format with black, :wq to come back the ide)

It’s so grating for me that I can’t believe it used to happen before. I’m sure I would have noticed.

That said, I’ve recently moved from Linuxlite to Ubuntu, so maybe that’s a factor even though LinuxLite is based on Ubuntu.

I really must get around to setting that up. Whilst I’m not a huge fan of vi/vim, I do use it a lot over ssh so I’m getting more proficient at it.

Is it browser specific? I only ever use Firefox, but it’s always done this on both my Ubuntu desktop and my Mac laptop.

It works OK on Chrome.

I moved away from Chrome to solve another niggle. I forget what that was now.

That would explain why you’ve only seen it recently and it’s driven me nuts for as long as I can remember!

(I use Firefox for Anvil mostly for the multi-account containers add-on for which there is no equivalent in Chrome. It lets me use my various anvil accounts simultaneously in different tabs)

Hmm, I don’t think I can live with this. I’m going to move back to Chrome (and probably rediscover why I moved away from it …)

Anvil Central - is this behaviour on your radar?

1 Like

Hi @david.wylie,

Thanks for letting us know.

Could you send over a set of instructions to reproduce this behaviour? I can’t seem to in Firefox 81.0.2 (64-bit).

I’m on FF 82.0 on Ubuntu 20.04 (but this has been the behaviour I’ve known in the IDE on both Ubuntu and Mac since I started using Anvil).

to reproduce:

  • call a function that takes more than one argument
  • enter the first argument on a new line with a comma at the end
  • press enter to attempt to start a new line for the next argument

At this point, the autocompleter will prompt for the second argument and the ‘enter’ will add it

Hi @bridget,

I’m also on Ubuntu 20.4. I don’t recall this happening in LinuxLite which is based on Ubuntu, but my memory is unreliable …

Simple way to reproduce it (even simpler than the gif above) :

  • start typing anvil.
  • after the dot, press the escape key to remove the pop-up autocompleter.

and the focus will be lost. Happens client and server side.

1 Like

Just a FYI.

I have reinstalled my OS (there are other issues with Ubuntu 20.4 that I can’t live with) and the issue has gone for me.

Oddly, I’m using LinuxLite 5 which is based on Ubuntu 20.4 but it doesn’t seem to suffer from any of the issues, including the one in this thread.

This also happens on Chrome/Windows - or atleast used to. I will monitor and report back