@@ -589,10 +589,6 @@ export const GridMixin = (superClass) =>
589
589
} ) ;
590
590
}
591
591
592
- if ( column && column . _onCellKeyDown ) {
593
- cell . addEventListener ( 'keydown' , column . _onCellKeyDown . bind ( column ) ) ;
594
- }
595
-
596
592
const slot = document . createElement ( 'slot' ) ;
597
593
slot . setAttribute ( 'name' , slotName ) ;
598
594
@@ -681,6 +677,9 @@ export const GridMixin = (superClass) =>
681
677
cell = column . _cells . find ( ( cell ) => cell . _vacant ) ;
682
678
if ( ! cell ) {
683
679
cell = this . _createCell ( 'td' , column ) ;
680
+ if ( column . _onCellKeyDown ) {
681
+ cell . addEventListener ( 'keydown' , column . _onCellKeyDown . bind ( column ) ) ;
682
+ }
684
683
column . _cells . push ( cell ) ;
685
684
}
686
685
cell . setAttribute ( 'part' , 'cell body-cell' ) ;
@@ -724,7 +723,13 @@ export const GridMixin = (superClass) =>
724
723
// Header & footer
725
724
const tagName = section === 'header' ? 'th' : 'td' ;
726
725
if ( isColumnRow || column . localName === 'vaadin-grid-column-group' ) {
727
- cell = column [ `_${ section } Cell` ] || this . _createCell ( tagName , column ) ;
726
+ cell = column [ `_${ section } Cell` ] ;
727
+ if ( ! cell ) {
728
+ cell = this . _createCell ( tagName ) ;
729
+ if ( column . _onCellKeyDown ) {
730
+ cell . addEventListener ( 'keydown' , column . _onCellKeyDown . bind ( column ) ) ;
731
+ }
732
+ }
728
733
cell . _column = column ;
729
734
row . appendChild ( cell ) ;
730
735
column [ `_${ section } Cell` ] = cell ;
0 commit comments