Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Deleting part of hex color breaks Color Editor #10357

@marcelgerber

Description

@marcelgerber

I found this while trying to reproduce #2166:

  1. In a CSS file, type #abcdef;
  2. Put the cursor inside the color
  3. Ctrl-E to bring up the color editor
  4. In the main editor, select f; and delete it
  5. Then try to change the color in the picker

Result:
Console spam à la

 Uncaught TypeError: Cannot read property 'length' of undefined codemirror.js:3515
makeChangeInner codemirror.js:3510
makeChange codemirror.js:3708
replaceRange codemirror.js:6475
createObj.replaceRange codemirror.js:6766
(anonymous function) Document.js:369
Document.replaceRange InlineColorEditor.js:156
(anonymous function) codemirror.js:2140
runInOp codemirror.js:4430
CodeMirror.operation Document.js:403
Document.batchOperation InlineColorEditor.js:154
InlineColorEditor._handleColorChange ColorEditor.js:413
ColorEditor._commitColor ColorEditor.js:399
ColorEditor.setColorAsHsv ColorEditor.js:450
ColorEditor._handleSelectionFieldDrag jquery-2.1.1.min.js:3
n.event.dispatch jquery-2.1.1.min.js:3
r.handle jquery-2.1.1.min.js:3

Brackets @47293e9af276179dbd93cfe13e9edef6bed97c52

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions