Skip to content

Selecting code code on mobile either impossible or selects line numbers as well #3460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bojidar-bg opened this issue Apr 19, 2025 · 1 comment
Labels

Comments

@bojidar-bg
Copy link

bojidar-bg commented Apr 19, 2025

p5.js version

N/A - 2.0.0

What is your operating system?

Android 15

Web browser and version

Firefox Android 137.0.2 / Chrome Android 135.0.7049.100

Actual Behavior

Trying to select code on Android through long pressing and moving the handles is impossible on both browsers. Using Select All works (though it requires some finesse to hit), but copying the selection copies only the last line on Chrome (Firefox works alright, though there are ways to accidentally select line numbers too).

Doing a combined Select All and Copy operation through Thumbkey selects both the code and the line numbers on the side before copying on Firefox. (Same on Chrome copies only the last line)

Expected Behavior

I can select parts of the code freely, using the native Android selection controls, including the handles at the edges of the selection and the Select All button. When I copy some part of the code, I copy only the code, without line numbers; and I copy all the lines I've selected and not just the first/last one.

Custom keyboards like Thumbkey that include a Copy All button don't copy line numbers with the code.

Steps to reproduce

Steps:

  1. Create a new sketch on Android
  2. Select a whole word through long-pressing on it
  3. Try to extend the selection by dragging the handles -> Handles not shown
  4. Try to extend the selection by pressing the Select All button -> Can be accessed only by long-pressing the selection again.
  5. Try to copy a multi-line selection -> impossible on Chrome

I guess this could be termed a CodeMirror issue; however, the examples on both https://codemirror.net/5/ and https://codemirror.net/ work markedly better - allowing editing the selection through handles. The only place CodeMirror 5 fails is the Thumbkey Copy All feature under Chrome, but Select All + Copy works okay (and CodeMirror 6 does fix that). Hence, opening the issue here, in case the web editor is doing something funny too (:

@bojidar-bg bojidar-bg added the Bug label Apr 19, 2025
@Jatin24062005
Copy link
Contributor

Jatin24062005 commented Apr 20, 2025

Hey @bojidar-bg Just wanted to add that the p5.js Web Editor team is actively working on upgrading CodeMirror to version 6, which should help address many of these mobile selection and copying issues. You can see progress mentioned in their September 2024 monthly report here:
🔗 https://github.com/processing/pr05-grant/blob/main/2024_NewBeginnings/monthly-reports/pr05_2024_September_report_Nahee_Kim.md

Really looking forward to the improved experience this upgrade will bring, especially for mobile users. If the issue still persists even after the upgrade, I’ll do my best to help investigate and fix it. Thanks again for highlighting the specific problems—this kind of feedback is super valuable for the devs working on accessibility and cross-device usability!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants