Css values are not copied to clipboard if checkbox to enable / disable them is selected as well
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox86 fixed)
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: christoph.mosimann, Assigned: nchevobbe)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Steps to reproduce:
- Open the inspector, inspect an element
- Click to the right side of the element, click and hold the left mouse button down and drag the cursor to the left until full element is selected (name+value+checkbox). Make sure to drag the cursor to the left fully to the left side of the activation checkbox)
- Hit ctrl + c
- Example:
[x] color: black; <- Click here and drag cursor to the left to select the line.
4.1 If cursor is dragged over the checkbox [x], line can't be copied using ctrl+c
That's just annoying.
Actual results:
The element (setting and value) is not copied to clipboard. Only way to copy is to precisely not select the checkbox to enable / disable the target css element.
Expected results:
It should be copied to the clipboard in any case.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
•
|
||
Likely a duplicate of Bug 1650125 (Windows) and Bug 1635618 (Ubuntu). Couldn't reproduce either on macOS.
I suggest keeping this instead because it has clearer steps to reproduce.
Possible root causes:
appearance: none
or something in the custom OS styles for .ruleview-enableproperty. (Maybe tryuser-select: none
?)- stop propagation for the events on the checkbox
Assignee | ||
Comment 2•4 years ago
|
||
This is the faulty code: https://searchfox.org/mozilla-central/rev/4415bec7a49c50a338167d9c8934527b9cae59d0/devtools/client/inspector/rules/rules.js#556-568
Here, with Comment 0 STR, the target is the checkbox, which is an input, so it goes into the first if
block where retrieve the selectionStart/End
from said target. Here with the checkbox, it will be null, and in the end this will produce an empty string.
Assignee | ||
Comment 3•4 years ago
|
||
I'm going to take this
Assignee | ||
Comment 4•4 years ago
|
||
When selecting something in the rule view, if the user
moused up right onto the enable/disable rule checkbox,
and then tried to copy the selection, the clipboard was empty.
This is due to copySelection checking the target of the copy
event and doing something special if it is an input or a textarea.
To fix this, we add an extra check to test if the input isn't
a checkbox.
A test case, failing without the fix, is added to ensure we don't
regress this.
Assignee | ||
Comment 5•4 years ago
|
||
I can confirm that the bug also happens on Ubuntu, and that my patch fixes the issue there as well :)
Comment 8•4 years ago
|
||
Thank you for the investigation and for fixing this, Nicolas! I marked the other bugs as duplicates of this one.
Comment 10•4 years ago
|
||
bugherder |
Description
•