nextcloud / text

📑 Collaborative document editing using Markdown
GNU Affero General Public License v3.0
539 stars 87 forks source link

Copy, Cut doesn't go to the clipboard #1508

Closed zydisney closed 1 year ago

zydisney commented 3 years ago

Describe the bug When use any method of copy or cut the content in the text. It doesn't go to the clipboard. (e.g. Use ctrl+x to cut the text, the selected content removed from the text, but you cannot paste it either in the text or other program).

Client details:

Netroxen commented 3 years ago

This error is also reproducible for me on Windows 10:

I have also tested Chrome 89.0.4389.82 on Ubuntu 20.04.2 LTS and it works as expected ...

Edit: Some additional information, this is also reproducible on Edge (although Edge also runs on the Chromium engine), so that's to be expected. In addition, this bug seems to be prevalent only since updating the text module on Nextcloud.

XL-Maggus commented 3 years ago

hello, same here

Chrome 89.0.4389.82 Works on Firefox tested on Chrome 89.0.4389.82

szaimen commented 3 years ago

cc @juliushaertl

Netroxen commented 3 years ago

Are there any developments or solutions to this issue, as it's making it very difficult to work with documents within NC ..?

juliushaertl commented 3 years ago

I cannot reproduce this. Please fill out the issue template especially with version of Nextcloud and text you are using.

szaimen commented 3 years ago

@juliushaertl Here you go:

OS

Linux 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64

Webserver

Apache (fpm-fcgi)

Database

pgsql PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

PHP version

7.4.3 Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, cgi-fcgi, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imap, intl, json, ldap, exif, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version

20.0.8 - 20.0.8.1

Updated from an older Nextcloud/ownCloud or fresh install

Nextcloud 20.0.7

Where did you install Nextcloud from

Nextcloud VM

Signing status

Array ( )

List of activated apps

Enabled:
 - accessibility: 1.6.0
 - activity: 2.13.4
 - admin_audit: 1.10.0
 - apporder: 0.12.0
 - bookmarks: 4.1.0
 - bruteforcesettings: 2.0.1
 - calendar: 2.2.0
 - cloud_federation_api: 1.3.0
 - cms_pico: 1.0.14
 - contacts: 3.5.1
 - contactsinteraction: 1.1.0
 - cospend: 1.3.0
 - dashboard: 7.0.0
 - dav: 1.16.2
 - deck: 1.2.5
 - drawio: 1.0.0
 - event_update_notification: 1.2.0
 - extract: 1.3.1
 - federatedfilesharing: 1.10.2
 - files: 1.15.0
 - files_antivirus: 3.2.0
 - files_external: 1.11.1
 - files_linkeditor: 1.1.5
 - files_markdown: 2.3.3
 - files_mindmap: 0.0.24
 - files_pdfviewer: 2.0.1
 - files_readmemd: 1.2.0
 - files_rightclick: 0.17.0
 - files_sharing: 1.12.2
 - files_texteditor: 2.14.0
 - files_trashbin: 1.10.1
 - files_versions: 1.13.0
 - files_videoplayer: 1.9.0
 - forms: 2.2.3
 - geoblocker: 0.4.6
 - impersonate: 1.7.0
 - issuetemplate: 0.7.0
 - limit_login_to_ip: 3.1.0
 - logreader: 2.5.0
 - lookup_server_connector: 1.8.0
 - metadata: 0.13.0
 - music: 1.1.0
 - nextcloud_announcements: 1.9.0
 - notifications: 2.8.0
 - oauth2: 1.8.0
 - onlyoffice: 6.3.0
 - password_policy: 1.10.1
 - photos: 1.2.3
 - polls: 1.8.1
 - previewgenerator: 3.1.1
 - provisioning_api: 1.10.0
 - radio: 1.0.3
 - rainloop: 7.1.2
 - ransomware_protection: 1.10.0
 - recommendations: 0.8.0
 - riotchat: 0.7.4
 - serverinfo: 1.10.0
 - settings: 1.2.0
 - spreed: 10.0.6
 - suspicious_login: 3.2.1
 - talk_simple_poll: 1.3.0
 - tasks: 0.13.6
 - text: 3.1.0
 - theming: 1.11.0
 - theming_customcss: 1.8.0
 - timemanager: 0.1.8
 - twofactor_nextcloud_notification: 3.1.2
 - updatenotification: 1.10.0
 - video_converter: 1.0.1
 - viewer: 1.4.0
 - weather_status: 1.0.0
 - whiteboard: 0.0.3
 - workflowengine: 2.2.0
Disabled:
 - comments
 - encryption
 - federation
 - firstrunwizard
 - podcast
 - privacy
 - sharebymail
 - support
 - survey_client
 - systemtags
 - user_ldap
 - user_status

Configuration

{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "192.168.178.30",
        "example.com",
        "office.example.com"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "pgsql",
    "version": "20.0.8.1",
    "overwrite.cli.url": "https:\/\/example.com\/",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "log_type": "file",
    "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
    "loglevel": "2",
    "mail_smtpmode": "smtp",
    "log_rotate_size": "10485760",
    "trashbin_retention_obligation": "auto, 180",
    "versions_retention_obligation": "auto, 365",
    "simpleSignUpLink.shown": false,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0.5,
        "dbindex": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "logtimezone": "Europe\/Berlin",
    "htaccess.RewriteBase": "\/",
    "maintenance": false,
    "mail_smtpsecure": "ssl",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "share_folder": "\/Shared",
    "enable_previews": true,
    "preview_max_x": "1024",
    "preview_max_y": "1024",
    "jpeg_quality": "60",
    "theme": "",
    "updater.release.channel": "stable",
    "twofactor_enforced": "true",
    "twofactor_enforced_groups": [],
    "twofactor_enforced_excluded_groups": [
        "disabled_twofactorauth"
    ],
    "lost_password_link": "disabled",
    "allow_user_to_change_display_name": false,
    "knowledgebaseenabled": false,
    "log.condition": {
        "apps": [
            "admin_audit"
        ]
    },
    "data-fingerprint": "15ecc8d328274dc1d7c0f6b74d59d72f",
    "enabledPreviewProviders": {
        "11": "OC\\Preview\\PNG",
        "12": "OC\\Preview\\JPEG",
        "13": "OC\\Preview\\GIF",
        "14": "OC\\Preview\\BMP",
        "16": "OC\\Preview\\MP3",
        "18": "OC\\Preview\\Movie"
    }
}

Are you using external storage

local

Are you using encryption

no

Are you using an external backend

No

User agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Safari/537.36

Logs

No applicable webserver log No applicable Nextcloud log No applicable browser log

kamanwu commented 3 years ago

I have the same issue now. Is it resolved?

I still have this issue. When I try on Linux/Mac machine, I do not have this issue.
When I try on my friend's windows machine (win 10 pro), it works fine. It only happened on my windows machine (win 10 home). I do not have another win 10 home machine to test.

I try several browsers (Firefox , Chrome, edge) on my machine (win 10 home), all have the same issue.

Also, when I copy/cut outside of "text", it works fine as well.

https://recordit.co/QQp6L0iUDE

juliushaertl commented 3 years ago

Maybe someone who can reproduce this could run the following snipped on the javascript console when having the text app open, and then try to copy: If the browser properly triggers the copy event it should print the clipboard content to the console.

document.addEventListener('copy', (event) => {
    const selection = document.getSelection();
    console.log('document', selection.toString());
});
szaimen commented 3 years ago

I got the following directly after pasting the snippet into the console: image copying text from the text app still doesn't work afterwards and it doesn'r print the selected and copied text into the console...

szaimen commented 3 years ago

This seems to happen only on Windows...

juliushaertl commented 3 years ago

@szaimen Can you reproduce that on windows? Is there any additional tool involved in your setup for clipboard management? Any browser extensions enabled (maybe you could test with a browser without any)?

sailr7 commented 3 years ago

@juliushaertl This also happening on Chrome OS as that's what I'm using. It is not an extension issue as I have also tried in Incognito Mode and am encountering the same problem.

sailr7 commented 3 years ago

I will also mention that when this happens, the highlighted text seems to clear and then reappear again when attempting to copy -- so it flashes on the screen. When the copy functionality works (on other devices) this behavior does not happen. See the attached screenshot that shows the flashing effect.

https://user-images.githubusercontent.com/32799575/130243894-27b8985f-b005-4f67-99ea-712bf3660e29.mp4

juliushaertl commented 3 years ago

Could you maybe check if the issue also occurs on https://v1.tiptap.dev/ which is the upstream library we use for the editor?

szaimen commented 3 years ago

In the mentioned demo, copy to clipboard works for me.


I could reproduce the original issue on NC21.0.4 with Chromium 92 based browsers (Brave and Microsoft Edge) but in Firefox 91 it works on Windows.

szaimen commented 3 years ago

Edit: the issue seems to be fixed on NC22.1.0 and c.nc.c with NC22.1.1 RC1

juliushaertl commented 3 years ago

Is there any difference between right-click copy and using ctrl+c ? I'm wondering if there is any listener for a keyboard event that might cause this.

juliushaertl commented 3 years ago

Edit: the issue seems to be fixed on NC22.1.0 and c.nc.c with NC22.1.1 RC1

Might be just that there is a different constellation of apps in place as i don't remember any changes in that regard for the text app.

szaimen commented 3 years ago

Is there any difference between right-click copy and using ctrl+c ? I'm wondering if there is any listener for a keyboard event that might cause this.

There is no difference. It doesn't work via ctrl+c nor via right-click copy.

szaimen commented 3 years ago

I tried to enable all apps that are activated on my production instance in a test VM and it still works on NC22.1.0 so it seems to be fixed. Maybe a dependency update fixed it?

kamanwu commented 3 years ago

I am still on version: Nextcloud 21.0.3. I just add the js code and did the test: https://recordit.co/7QMUSt5SnP

ctrl+c and right-click copy are exactly same.

marcelklehr commented 1 year ago

If anyone is still running into this in a recent Nextcloud version feel free to comment here and we'll investigate again. I'm closing this for now.