ashmind / SharpLab

.NET language playground
https://sharplab.io
BSD 2-Clause "Simplified" License
2.72k stars 200 forks source link

Autocompletion menu functionality is broken, text is deleted instead of inserted #1316

Open eduarddejong opened 11 months ago

eduarddejong commented 11 months ago

When inserting code from the IntelliSense menu, all code from the text cursor to the beginning is completely deleted. Nothing is inserted at all.

The most difficult thing is that it's really hard to avoid, since the menu opens itself frequently and typing characters leads to auto selecting text options in the menu, which already makes the experience really buggy. (That problem exists much longer, in VS and VS Code insertions are never automatically made by typing, only by explicitly confirming the selected item by pressing Enter, but on SharpLab this does not function properly. However, the deletion issue is is new, I haven't noticed that earlier.)

Thanks for this great extension anyway, it's otherwise really useful!

Browser: Firefox

JasonBock commented 10 months ago

Thankfully someone else noticed this. I haven't been to sharplab.io in a while, and when I tried to use it today, I wondered if my keyboard was possessed :). Whatever this behavior is, it's making sharplab.io unusable.

jnm2 commented 10 months ago

This also seems to happen when typing <, >, or ;, without me seeing autocomplete being involved.

JasonBock commented 10 months ago

This also seems to happen when typing <, >, or ;, without me seeing autocomplete being involved.

Yeah something seems very borked on the site :(

ashmind commented 10 months ago

Thanks for reporting! Unfortunately I can't reproduce it (including on Firefox).

Is this on specific branch (main vs Default)? Can you maybe share a recording of the problem?

jnyrup commented 10 months ago

This example is reproducible for me: https://sharplab.io/#v2:EYLgtghglgdgNAFxAJwK4wD4AEBMBGAWAChiAxAe3IAoBKAbmKwBYACC6m4gb2Jb5ZgBTAO4sAgrQB0AIQjIqMVABsl9XvyGiJNGRABeC5aoZEAvsQskrlm9bu2H9p45fO3rj+6+fHAZwRoAMYI4izc/GFEEVgAzCzMLLLyWHgADCz+yJxR/Dw5EXwpAJxUAERJpWr5BcVlFVUR5vnqhXEJsgYp6ZnZEXkF/LXl+pUmA4V4JcN6oy0sTaZAA

What I notice: The glitch only seems to happen when running the code and when editing the code makes a "visual jump" during execution. I suspect this is somehow related to the insertion of the three icons image

In this video, see how after commenting out some code, repeatedly pressing right-arrow to move the cursor through the lines, shows that the righmost column on each line where the cursor is placed, corresponds to the righmost column on the line below. https://github.com/ashmind/SharpLab/assets/919634/2c2c69bc-52ae-4515-a015-1b83795fee73

ashmind commented 10 months ago

Thanks, I can reproduce this. It might be a bit tricky to resolve (likely an issue in editor component internals), but I'll take a look when I am able.

eduarddejong commented 9 months ago

By the way, mabe it's also good to check the Visual Basic experience.

Issues are very easy to notice with it.

PrashantUnity commented 9 months ago

today it won't let me type any thing. Whenever there comes any Auto Suggestion it removes everything upto that point.

One things i also noticed that . Sometimes on reloading full page it works perfectly.

Thus Issue i found while i am using Chrome But i haven't any issue while using Opera

https://github.com/ashmind/SharpLab/assets/48068632/c7667499-7567-4ff1-9b89-5de30bd95c11

Phyyl commented 7 months ago

Same issue here but in Chrome.

jcouv commented 7 months ago

@ashmind If it's tricky to fix, might disabling the completion be a workable mitigation?

vladd commented 5 months ago

Looks like it works now? Using newest Firefox.

dongle-the-gadget commented 5 months ago

Nope, still deletes code here. On iOS 18 Safari

jnm2 commented 5 months ago

It depends on which branch you have selected. It deletes code constantly for me with main selected.

siegfriedpammer commented 2 months ago

Still an issue... please add an option to disable code completion.

B1Z0N commented 2 months ago

It's broken. Can we fix this somehow? I can invest time, but please we need it fixed so badly...

canton7 commented 2 months ago

It depends on which branch you have selected. It deletes code constantly for me with main selected.

See above. Select a branch other than main, and it works fine.