Backspace key deletes selected row even when editing a value
Categories
(DevTools :: Storage Inspector, defect, P3)
Tracking
(firefox68 verified)
Tracking | Status | |
---|---|---|
firefox68 | --- | verified |
People
(Reporter: fvsch, Assigned: fvsch)
References
Details
(Whiteboard: [qa-68b-p2])
Attachments
(1 file)
Probably an issue introduced in bug 1522893.
(As a side note, I'm not sure why Backspace removes the selected row but Suppr doesn't. A macOS keyboard bias maybe?)
Steps to reproduce:
- Visit https://www.wikipedia.org/
- Open the Storage Inspector and select Cookies > https://www.wikipedia.org
- Double-click a value to edit it.
- Hit the Backspace key.
Expected result: the text input's value should be cleared (if selected) or the character to the left of the caret should be removed.
Actual result: the currently selected row is removed.
Assignee | ||
Comment 1•5 years ago
|
||
Getting decent results with:
diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -1137,10 +1137,13 @@ class StorageUI {
this.sidebarToggledOpen = false;
event.stopPropagation();
event.preventDefault();
- } else if (event.keyCode == KeyCodes.DOM_VK_BACK_SPACE && this.table.selectedRow) {
- this.onRemoveItem();
- event.stopPropagation();
- event.preventDefault();
+ } else if (event.keyCode == KeyCodes.DOM_VK_BACK_SPACE ||
+ event.keyCode == KeyCodes.DOM_VK_DELETE) {
+ if (this.table.selectedRow && event.target.nodeName !== "textbox") {
+ this.onRemoveItem();
+ event.stopPropagation();
+ event.preventDefault();
+ }
}
}
Hey Florens, if you submit the patch I'll review and land it straight away.
Assignee | ||
Comment 3•5 years ago
|
||
I'm on something else right now but will try to push the patch soon.
David, can I pick your brain since you proposed deleting on Backspace originally? What do you think about also using the Delete key for the same action? On some keyboards (especially for Windows/Linux) I tend to use Delete more, and Backspace on macOS only for lack of a Delete key (I think you get Delete with Fn+Backspace?). Should we match both?
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Pushed by florens@fvsch.com: https://hg.mozilla.org/integration/autoland/rev/a7af13fee7b2 Prevent backspace from deleting Storage entry when editing; r=miker
Comment 7•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Confirmed with 68.0a1(20190415213626).
Fix verified with 68.0.1, 69.0b11 on Windows 10, macOS 10.13, Ubuntu 16.04.
Description
•