Selecting/copying/pasting in Editor does not work on mobile devices
Summary
The code editor does not allow selecting blocks of code on mobile device (tested on iOS and Android).
Use case: Using mobile devices is now rather common, either to make quick edits when on the go, or for people who have health issues (e.g. Repetitive Stress Injuries) and are unable to use a normal keyboard. Selecting text works fine in any browser for a "textarea" element, so this is expected to work.
Attempting to move a block of code is extremely difficult without the ability to select and then cut or copy text. In order to do this now, our current workaround is to copy the code we want to move before going into edit mode, go to the end of the block and then backspace the entire code block. Then we attempt to get the cursor in the right place and long-click to paste. Pasting text does work as expected. This means for every block of text we want to move using the web interface is a separate commit, and we have to keep going back and forth between the view and edit modes, which is frustrating.
This ticket should be taken into consideration if #29463 (closed) is done.
Steps to reproduce
Steps to reproduce:
- Go into any repo and navigate to a text file (e.g. a .md file)
- Click the edit button in the upper right
- Attempt to select text
Example Project
Any project with a text file can be used
What is the current bug behavior?
The cursor moves but there's no way to select text
What is the expected correct behavior?
User is able to select text
Relevant logs and/or screenshots
n/a
Output of checks
This happens on all GitLab servers, so yes, This bug happens on GitLab.com (but not only on GitLab.com).
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.22.0 Sidekiq Version:5.2.7 Go Version: unknownGitLab information Version: 12.2.4-ee Revision: e57d66ff40e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.9 URL: https://gitlab.hax0rbana.org HTTP Clone URL: https://gitlab.hax0rbana.org/some-group/some-project.git SSH Clone URL: git@gitlab.hax0rbana.org:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 9.3.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/1 ... yes 4/2 ... yes 2/3 ... yes 4/4 ... yes 5/5 ... yes 5/6 ... yes 6/7 ... yes 6/8 ... yes 6/9 ... yes 6/10 ... yes 6/11 ... yes 6/12 ... yes 6/13 ... yes 6/14 ... yes 6/15 ... yes 6/16 ... yes 2/17 ... yes 2/18 ... yes 2/19 ... yes 2/20 ... yes 2/24 ... yes 5/25 ... yes 2/26 ... yes 2/27 ... yes 2/28 ... yes 6/29 ... yes 7/30 ... yes 5/31 ... yes 3/32 ... yes 3/33 ... yes 3/34 ... yes 4/35 ... yes 4/36 ... yes 3/37 ... yes 3/38 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 4 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
I would expect this issue to be part or the requirements for #29463 (closed) which is to replace or re-write the editor component. If an editor which is mobile friendly is chosen, the problem should go away.