New issue
Advanced search Search tips

Issue 899545 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 18
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

IndexedDB editor deletes an entire record instead of text selection when the Delete key is pressed

Reported by woxxom@gmail.com, Oct 28

Issue description

Chrome: all versions since 65 including Canary
OS:     Windows 7

=============================================================

Short repro:
1. double-click a value in DevTools IndexedDB editor, select something, press the Delete key

Expected: only the selected part (or value) is deleted
Observed: the entire entry object is deleted

=============================================================

Long repro:
1. open https://mdn.github.io/learning-area/javascript/apis/client-side-storage/indexeddb/notes/
2. type 123 in "Note title" and "Note text", click "Create new note"
3. open devtools, switch to Applications panel
4. expand IndexedDB, "notes - https://...."
5. double-click "notes"
6. expand the value on the right
7. double-click "123"
8. select something, for example "2"
9. press the Delete key on keyboard or via choose "Delete" in the right-click context menu

=============================================================

Bisected to r522687 = f249e41fef643bb8de115ba0363d1c18cb91a0d1 = https://crrev.com/c/804599 by eostroukhov@chromium.org
"[DevTools] Single item deletion for IndexedDB"
Landed in 65.0.3289.0
 
chrome_2018-10-28_19-15-01.png
32.3 KB View Download
Labels: Needs-Triage-M70
Owner: hhli@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report, I'm able to repro.  We likely need to add an `isEditing` check in the view to avoid handling 'Delete' when a textarea has focus.

hhli@, could you please take a look?
Labels: -Pri-3 Pri-1
Status: Fixed (was: Assigned)
CL1383037

Select value to edit: image #1
The value is deleted, instead of deleting the whole entry: image #2
Screen Shot 2018-12-18 at 13.10.45.png
30.2 KB View Download
Screen Shot 2018-12-18 at 13.12.53.png
27.9 KB View Download
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4f5cc233f0d79a679046af9245de69daeee4f3b

commit c4f5cc233f0d79a679046af9245de69daeee4f3b
Author: Harley Li <hhli@chromium.org>
Date: Wed Dec 19 00:35:01 2018

[DevTools] Prevent deleting text from deleting entire entry in IndexedDB

Use UI.isEditing() is DataGrid._keydown() event handler to check if the
DataGrid is being edited.

When a delete key event arrives, event.target is always the div element
(the element that surrounds the textarea being edited) so one needs to
resort to document.deepActiveElement() defined in DOMExtension.js, to
check if a textarea is being edited, and UI.isEditing() is a wrapper
for it. If UI.isEditing() returns true, the entry that textarea belongs
to should not be deleted.

Bug:  899545 
Change-Id: I598677d2cdccf90df5f8177be68a1ef1d4642938
Reviewed-on: https://chromium-review.googlesource.com/c/1383037
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617689}
[modify] https://crrev.com/c4f5cc233f0d79a679046af9245de69daeee4f3b/third_party/blink/renderer/devtools/front_end/data_grid/DataGrid.js

Sign in to add a comment