microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.29k stars 29.31k forks source link

Folding: sometimes can not be folded and touch registered as double click #121203

Open isidorn opened 3 years ago

isidorn commented 3 years ago

iPad or any touch device

Have some code folded Touch on the folded region fold decorations to expand it -> all good Touch again to fold it -> sometimes touch is registered as a double click, thus both an expand and a collapse happens thus resulting in no action

Not sure if this is specific to folding or to all decorations but first assigning to @aeschli

aeschli commented 3 years ago

@isidorn Can I point you to the code and you have look? You have the IPad setup ready and know how to debug this... https://github.com/microsoft/vscode/blob/main/src/vs/editor/contrib/folding/folding.ts#L351

isidorn commented 3 years ago

Thanks, I can take a look

isidorn commented 3 years ago

@aeschli I have debugged this and the problem seems to be that on touch the editor emits On Mouse Up On Mouse Down On Mouse Up

The first mouse up is generated from the Pointer Up event here And the other mouse up is generated from the mouse up event here

@rebornix could we somehow combine these two pointer and mouse events so that we do not trigger duplicate events?