@@ -8,7 +8,6 @@ import { ChevronDownIcon } from '../icons/chevrondown';
88import { ChevronRightIcon } from '../icons/chevronright' ;
99import { PencilIcon } from '../icons/pencil' ;
1010import { TimesIcon } from '../icons/times' ;
11- import { OverlayService } from '../overlayservice/OverlayService' ;
1211import { Ripple } from '../ripple/Ripple' ;
1312import { DomHandler , IconUtils , ObjectUtils , classNames } from '../utils/Utils' ;
1413import { RowCheckbox } from './RowCheckbox' ;
@@ -21,8 +20,6 @@ export const Cell = (props) => {
2120 const [ styleObjectState , setStyleObjectState ] = React . useState ( { } ) ;
2221 const elementRef = React . useRef ( null ) ;
2322 const keyHelperRef = React . useRef ( null ) ;
24- const overlayEventListener = React . useRef ( null ) ;
25- const selfClick = React . useRef ( false ) ;
2623 const focusTimeout = React . useRef ( null ) ;
2724 const initFocusTimeout = React . useRef ( null ) ;
2825 const editingRowDataStateRef = React . useRef ( null ) ;
@@ -58,9 +55,9 @@ export const Cell = (props) => {
5855 } ;
5956
6057 const isIgnoredElement = ( element ) => {
61- const isCellEditor = ( el ) => el . getAttribute && el . getAttribute ( 'data-pr-is-overlay' ) ;
58+ const isOverlay = ( el ) => el . getAttribute && el . getAttribute ( 'data-pr-is-overlay' ) ;
6259
63- return isCellEditor ( element ) || DomHandler . getParents ( element ) . find ( ( el ) => isCellEditor ( el ) ) ;
60+ return isOverlay ( element ) || DomHandler . getParents ( element ) . find ( ( el ) => isOverlay ( el ) ) ;
6461 } ;
6562
6663 const [ bindDocumentClickListener , unbindDocumentClickListener ] = useEventListener ( {
@@ -69,8 +66,6 @@ export const Cell = (props) => {
6966 if ( ! isIgnoredElement ( e . target ) && isOutsideClicked ( e . target ) ) {
7067 switchCellToViewMode ( e , true ) ;
7168 }
72-
73- selfClick . current = false ;
7469 } ,
7570 options : true ,
7671 when : isEditable ( )
@@ -121,9 +116,6 @@ export const Cell = (props) => {
121116 setTimeout ( ( ) => {
122117 setEditingState ( false ) ;
123118 unbindDocumentClickListener ( ) ;
124- OverlayService . off ( 'overlay-click' , overlayEventListener . current ) ;
125- overlayEventListener . current = null ;
126- selfClick . current = false ;
127119 } , 1 ) ;
128120 } ;
129121
@@ -176,7 +168,7 @@ export const Cell = (props) => {
176168 } ;
177169
178170 const onClick = ( event ) => {
179- props . onClick ( event , getCellCallbackParams ( event ) , isEditable ( ) , editingState , setEditingState , selfClick , props . column , bindDocumentClickListener , overlayEventListener , isOutsideClicked ) ;
171+ props . onClick ( event , getCellCallbackParams ( event ) , isEditable ( ) , editingState , setEditingState , props . column , bindDocumentClickListener ) ;
180172 } ;
181173
182174 const onMouseDown = ( event ) => {
@@ -277,8 +269,6 @@ export const Cell = (props) => {
277269 } ;
278270
279271 const onBlur = ( event ) => {
280- selfClick . current = false ;
281-
282272 if ( props . editMode !== 'row' && editingState && getColumnProp ( 'cellEditValidatorEvent' ) === 'blur' ) {
283273 switchCellToViewMode ( event , true ) ;
284274 }
@@ -364,11 +354,6 @@ export const Cell = (props) => {
364354 } , [ editingState ] ) ;
365355
366356 useUnmountEffect ( ( ) => {
367- if ( overlayEventListener . current ) {
368- OverlayService . off ( 'overlay-click' , overlayEventListener . current ) ;
369- overlayEventListener . current = null ;
370- }
371-
372357 if ( editingRowDataStateRef . current ) {
373358 editingRowDataStateRef . current = null ;
374359 }
0 commit comments