Drag&select doesn’t work in composer (iPad)

iPad (Safari and DiscourseHub) and some days now I can’t select text in the composer. I can double click but I can’t drag selection any wider.

And there is more, of course. It isn’t bother every time, but the most of time yes. And it looks like drag&select comes to back normal when I have at least two chapters.

Very strange.

1 Like

Great report, thanks @Jagster. This bit was very helpful:

When you perform a touch action on an element that doesn’t scroll, the browser (Safari in this case) propagates that event to the parent elements. In the composer, that means it propagates it back up to the body and then scrolls that body. Even though a) the body isn’t visible and b) the editor is in a fixed-positioned element, which usually doesn’t warrant scrolling the body.

So, to fix for this issue, we added some logic in JS that stops the touchmove event from doing its thing while the textarea is short. But inadvertently, that causes issues with text selection.

Just merged this PR to fix: FIX: Allow `touchmove` in composer when there is a selection by pmusaraj · Pull Request #30957 · discourse/discourse · GitHub

1 Like

Thanks! It works now perfectly.

1 Like