Code appears in inactive file tab

Just happened again with a javascript file open, and the results ended up in html file…so not necessarily a css thing.

I am on the windows version of this. And have been having the same issue.

Its when I am editing code in either code view or split view and it will add the text to another page that I have open. When I go to the page that it is actually writing on, and I delete that text, when I go back to the page I was trying to edit it will then allow me to edit that page again. Weird.

Hi @ George, it only happens to me when I have pages open and then I edit a .css file. it normally edits the file (tab open before the .css file tab).

I had this today also, Think i need to run in debugging mode all today and see if I can capture this. It isn’t always linked to css files but this seems to be the most common trigger for me.

We are aware of the problem and I also had it once, I was able to debug it to the Monaco editor, but could not find the exact cause. Also it is very difficult to reproduce, couldn’t reproduce the case after I had it once. It is also not specific to css files, it also happens with other files. It get fixed when you focus the editor where the edits are applied and then go back to the other editor.

From what I currently know is that it seems to be some focus problem with the Monaco Editor when there are multiple instances of the editor. It can even happen with multiple (more than 2) tabs open, all edits come in a single editor instance. I checked the public API of the editor and it seems to set the focus to the correct editor, but still it places the edits in the incorrect editor while the focus, copy and other editor specific actions work on the visible editor.

Actually it seems is a known Monaco Editor problem, but the guys from Microsoft aren’t solving it soon as they also have troubles in reproducing it …

See:

1 Like

Just reporting here what was discussed in a separate thread. I routinely have this problem - it seems most of the time when I try to edit a file that’s not generated through the Wapper UI (eg I open a PHP or XML file). It drives me to use an external editor and swap between Wappler for the graphical editing and external editor for code editing which isn’t a great experience unfortunately.

Is there an expected resolution for this?

This has been a serious problem for me since the Monaco editor was a added. At first, random sections of code on files in tabs without focus were being wiped out without my noticing. Then after some Wappler updates over time I settled into what is described in this thread. Namely, for random reasons the editor inserts what I type on another open file but not the one with focus. Over time with updates this has become less frequent but it still occurs. I cannot figure out the circumstances to trigger it either. I have just come to know that when I don’t see anything when I type I look at each tab to see where it inserted the text and I fix it. Then I restart Wappler. It used to happen every few hours or so but now I can go a whole day with it happening about once. Then again, I am in the habit of restarting Wappler every 3-4 hours anyway. I wish I could say how to reproduce it but I cannot. I am using a MAC.

Same here and in version Beta 3.0 seems to be worse!

it appears that even if you save all and move to a different tab any page editing shows the previous tab as being edited and changes required to be saved.

Using a MAC.

Im having this problem a lot and its really annoying, i have to close and reopen Wappler and sometimes all the changes i did are missing so i have to work double. @George, there is a chance to switch to another code editor engine? Thanks

If the problem with Monaco will not be addressed by Microsoft…is there any plan to work around the issue?

Microsoft reported that it might be fixed in their latest changes, but they aren’t releasing a new version yet - so we are waiting for that …

last version was from 6 months ago … seems they have shifted priorities …

@George

If it helps at all, today the bug is biting, but it would seem that a temporary fix after this occurs, is to toggle from the Design tab to the Code tab on the file receiving all the errant keystrokes. After I do that, I can get back to work. It provides temporary relief. :slight_smile: Maybe it points you to a way to resolve or workaround?

This would be great to resolve. My working process is to only ever have one file open at a time which is frustrating as I’m repeatedly opening and closing files just to check things or copy things when keeping them all open would be so much better.

Yes, this is also bugging me like mad, seems worst when you have a CSS file open

2 Likes

The biggest problem for us is to reproduce it. I also had it sometimes and was able to do some debugging, then I added some extra logging in the code and wanted to reproduce it again but didn’t happen. Spend a whole day trying to reproduce it without any success.

Without knowing what exactly is causing it and how to reproduce, it will be difficult for us to fix. I hope that I am able to reproduce it sometime to work on a fix.

From what I currently know is that it is a focus issue. Seems that a previous editor didn’t get a blur and thinks it has focus. If you go to that editor tab, focus it and then go back to the previous editor fixes it. Why it didn’t blur the editor in some cases is not yet known by us, probably some racing condition when a new tab/editor is opened.

3 Likes

With the new monaco update which will be included in the next Wappler update it should be gone. If it still happens after the update then open a new topic for it.

1 Like

This should be now fixed in Wappler 3.4.0 - the latest version of Monaco Editor has been added there.