Skip to content
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

Readme editor steals focus and can inadvertently capture keystrokes #4030

Closed
te-online opened this issue Apr 6, 2023 · 1 comment
Closed

Comments

@te-online
Copy link

te-online commented Apr 6, 2023

Steps to reproduce

  1. Open the files app
  2. Hit down arrow key on your keyboard
  3. Press Enter

Expected behaviour

The first folder or file in the list of files should open.

Actual behaviour

A new line is added to the Readme file.

Background

I'm running some basic end-to-end tests for my app Linkeditor. With NC 26 tests suddenly started to fail all over the place. I looked at the screenshot that Cypress took and saw that text was entered into the Readme section instead of into the "new file" input or the input in my app's modal (see screenshot below).

The reason for this is that initialization of the editor for the Readme section is async. And as soon as the editor has loaded it steals focus, leading to unpredictable results when either (1) loading of the editor is slow or like in this case (2) the (automated) user takes a different action really fast.

For now I solved this by making my tests wait a couple of seconds for the editor to be initialized before taking any other actions.

But I don't believe that stealing focus to the Readme section is the best solution. My suggestion would be to make this section manually focus-able by the user instead. What do you think?

Linkeditor -- can create a webloc link file (failed)

Server configuration

Operating system: N/A

Web server: N/A

Database: N/A

PHP version: N/A

Nextcloud version: 26.0.0

Where did you install Nextcloud from: Docker

List of activated apps:

Enabled:
  - activity: 2.18.0
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_linkeditor: 1.1.14
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - nextcloud_announcements: 1.15.0
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - password_policy: 1.16.0
  - photos: 2.2.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - recommendations: 1.5.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - support: 1.9.0
  - survey_client: 1.14.0
  - systemtags: 1.16.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - updatenotification: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - admin_audit: 1.16.0
  - bruteforcesettings: 2.6.0
  - encryption: 2.14.0
  - files_external: 1.18.0
  - firstrunwizard: 2.15.0 (installed 2.15.0)
  - suspicious_login: 4.4.0
  - twofactor_totp: 8.0.0-alpha.0
  - user_ldap: 1.16.0

Nextcloud configuration:

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "172.19.0.*"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.0.11",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***"
    }
}

Client configuration

Browser: Firefox 111.0.1

Operating system: MacOS

@juliusknorr juliusknorr transferred this issue from nextcloud/files_texteditor Apr 7, 2023
@juliusknorr
Copy link
Member

Noticed we actually have another ticket already about this #3962

@juliusknorr juliusknorr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants