Opened 6 years ago
Last modified 20 months ago
#44820 new defect (bug)
CodeMirror in Customize - copy & paste bug
Reported by: | dionysous | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | minor | Version: | 4.9 |
Component: | Customize | Keywords: | has-patch needs-testing |
Focuses: | ui, javascript, administration | Cc: |
Description
Wrong behavior in CodeMirror:
I go to Customize > Additional CSS and copy one selector including the opening curly bracket "{". I paste the copied text at the end of the content of the CSS textarea and press enter to create a new line. The new line won't be created, instead Autocompletion of CodeMirror is executed and the CSS attribute align-content is added.
Animated screen capture as GIF:
https://hipp.design/media/code-mirror-copy-paste.gif
It only happens, when the selector is pasted at the end (of the textarea) and if the CSS field was already filled out and the Customize have been saved before.
Attachments (2)
Change History (7)
#3
@
6 years ago
Hello @SergeyBiryukov ,
thank you for trying. Try copying this CSS code:
.class .class-2 #id-here { }
...and save the Customize options then. Reload the Customize.
Paste only this after the saved CSS code:
.class .class-2 #id-here {
The cursor/focus should be after the openin {. Next press enter key. Then the align-content suggestion should appear.
It happened for users on Windows, e.g. on Chrome or Firefox.
I could reproduce it now in Safari (latest) and Google Chrome (latest) on MacOS, but we have users/webdesigners, which reported us the problem on Windows systems.
Can you reproduce the bug now?
#4
@
5 years ago
- Keywords has-patch needs-testing added; reporter-feedback removed
- Milestone changed from Awaiting Review to Future Release
Thank you for the additional information, @dionysous!
I'm able to reproduce this bug consistently. In order to reproduce it, you need to to paste with Cmd+V
, and release the Cmd
key before releasing V
.
In code-editor.js
, in the wp.codeEditor.initialize
function, the keyup
event is deciding to show the autocomplete dropdown because isAlphaKey
is true
.
44820.2.diff fixes this issue, but I suspect that JS and HTML editing will have similar issues, too.
Hi @dionysous, welcome to WordPress Trac! Thanks for the report.
I could not reproduce the issue on a clean install with Opera 55 (Windows 10).