@@ -184,50 +184,60 @@ export const FlatTree = (props: FlatTreeProps) => {
184184 }
185185 } , [ focusEdit ] )
186186
187+ const [ onMouseEnter , setOnMouseEnter ] = useState ( false )
187188
188189 const Row = ( index : number ) => {
189190 const node = Object . keys ( flatTree ) [ index ]
190191 const file = flatTree [ node ]
191- return ( < li
192- className = { `${ labelClass ( file ) } li_tv` }
193- onMouseOver = { ( ) => setHover ( file . path ) }
194- onMouseOut = { ( ) => setHover ( file . path ) }
195- data-type = { file . isDirectory ? 'folder' : 'file' }
196- data-path = { `${ file . path } ` }
197- data-id = { `treeViewLitreeViewItem${ file . path } ` }
198- >
199- < div data-id = { `treeViewDivtreeViewItem${ file . path } ` } className = { `d-flex flex-row align-items-center` } >
200- { getIndentLevelDiv ( file . path ) }
192+ return (
193+ < li
194+ className = { `${ labelClass ( file ) } li_tv` }
195+ onMouseOver = { ( e ) => {
196+ console . log ( e )
197+ setHover ( file . path )
198+ } }
199+ onMouseOut = { ( ) => {
200+ setHover ( file . path )
201+ } }
202+ data-type = { file . isDirectory ? 'folder' : 'file' }
203+ data-path = { `${ file . path } ` }
204+ data-id = { `treeViewLitreeViewItem${ file . path } ` }
205+ onMouseEnter = { ( ) => setOnMouseEnter ( true ) }
206+ onMouseLeave = { ( ) => setOnMouseEnter ( false ) }
207+ >
208+ < div data-id = { `treeViewDivtreeViewItem${ file . path } ` } className = { `d-flex flex-row align-items-center` } >
209+ { getIndentLevelDiv ( file . path ) }
201210
202- < div className = { `pl-2 ${ file . isDirectory ? expandPath && expandPath . includes ( file . path ) ? 'fa fa-folder-open' : 'fa fa-folder' : `${ getPathIcon ( file . path ) } pr-2 caret caret_tv` } ` } > </ div >
203- { focusEdit && file . path && focusEdit . element === file . path ?
204- < FlatTreeItemInput
205- editModeOff = { editModeOff }
206- file = { file } /> :
207- < > < div
208- draggable = { true }
209- onDragStart = { onDragStart }
210- onDragEnd = { onDragEnd }
211- className = { `ml-1 pl-2 text-nowrap remixui_leaf ${ getFileStateClasses ( file ) } ` }
212- data-label-type = { file . isDirectory ? 'folder' : 'file' }
213- data-label-path = { `${ file . path } ` }
214- key = { index } >
215- { file . name }
211+ < div className = { `pl-2 ${ file . isDirectory ? expandPath && expandPath . includes ( file . path ) ? 'fa fa-folder-open' : 'fa fa-folder' : `${ getPathIcon ( file . path ) } pr-2 caret caret_tv` } ` } > </ div >
212+ { focusEdit && file . path && focusEdit . element === file . path ?
213+ < FlatTreeItemInput
214+ editModeOff = { editModeOff }
215+ file = { file } /> :
216+ < > < div
217+ draggable = { true }
218+ onDragStart = { onDragStart }
219+ onDragEnd = { onDragEnd }
220+ className = { `ml-1 pl-2 text-nowrap remixui_leaf ${ getFileStateClasses ( file ) } ` }
221+ data-label-type = { file . isDirectory ? 'folder' : 'file' }
222+ data-label-path = { `${ file . path } ` }
223+ key = { index } >
224+ { file . name }
216225
217- </ div >
218- < div className = "d-flex flex-row align-items-center" >
219- < div >
220- < FileHoverIcons
221- file = { file }
222- isEditable = { focusEdit && file . path && focusEdit . element === file . path }
223- hover = { hover . length > 0 }
224- />
225- </ div > { getFileStateIcons ( file ) }
226- </ div >
227- </ >
228- }
229- </ div >
230- </ li > )
226+ </ div >
227+ < div className = "d-flex flex-row align-items-center" >
228+ { ! onMouseEnter && (
229+ < div >
230+ < FileHoverIcons
231+ file = { file }
232+ isEditable = { true }
233+ />
234+ </ div > ) }
235+ { getFileStateIcons ( file ) }
236+ </ div >
237+ </ >
238+ }
239+ </ div >
240+ </ li > )
231241 }
232242
233243 return ( < >
0 commit comments