File tree 1 file changed +9
-6
lines changed
front_end/ui/legacy/components/data_grid 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -341,12 +341,15 @@ class DataGridElement extends HTMLElement {
341
341
moveDirection ?: string ) : void {
342
342
if ( node . isCreationNode ) {
343
343
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 ( ) ;
350
353
}
351
354
return ;
352
355
}
You can’t perform that action at this time.
0 commit comments