Skip to content

Commit e8b639c

Browse files
danilsomsikovDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Emit create event when user clicks outside of the editor
Bug: 408244902 Change-Id: I796e53b62a01219c84742373bf6e00c027f32560 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6436657 Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Auto-Submit: Danil Somsikov <dsv@chromium.org> Commit-Queue: Danil Somsikov <dsv@chromium.org>
1 parent 438be26 commit e8b639c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

front_end/ui/legacy/components/data_grid/DataGridElement.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,15 @@ class DataGridElement extends HTMLElement {
341341
moveDirection?: string): void {
342342
if (node.isCreationNode) {
343343
this.#usedCreationNode = node;
344-
if (moveDirection === 'forward') {
345-
const hasNextEditableColumn =
346-
this.#columns.slice(this.#columns.findIndex(({id}) => id === columnId) + 1).some(({editable}) => editable);
347-
if (!hasNextEditableColumn) {
348-
node.deselect();
349-
}
344+
let hasNextEditableColumn = false;
345+
if (moveDirection) {
346+
const index = this.#columns.findIndex(({id}) => id === columnId);
347+
const nextColumns =
348+
moveDirection === 'forward' ? this.#columns.slice(index + 1) : this.#columns.slice(0, index);
349+
hasNextEditableColumn = nextColumns.some(({editable}) => editable);
350+
}
351+
if (!hasNextEditableColumn) {
352+
node.deselect();
350353
}
351354
return;
352355
}

0 commit comments

Comments
 (0)