File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
client/modules/IDE/components/CollectionList Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,6 @@ const CollectionListRowBase = (props) => {
5555 closeAll ( ) ;
5656 setRenameOpen ( true ) ;
5757 setRenameValue ( props . collection . name ) ;
58- if ( renameInput . current ) {
59- renameInput . current . focus ( ) ;
60- }
6158 } ;
6259
6360 const handleRenameChange = ( e ) => {
@@ -71,6 +68,12 @@ const CollectionListRowBase = (props) => {
7168 }
7269 } ;
7370
71+ const handleRenameFocus = ( ) => {
72+ if ( renameInput . current ) {
73+ renameInput . current . focus ( ) ;
74+ }
75+ } ;
76+
7477 const handleRenameBlur = ( ) => {
7578 updateName ( ) ;
7679 closeAll ( ) ;
@@ -116,7 +119,10 @@ const CollectionListRowBase = (props) => {
116119 onKeyUp = { handleRenameEnter }
117120 onBlur = { handleRenameBlur }
118121 onClick = { ( e ) => e . stopPropagation ( ) }
119- ref = { renameInput }
122+ ref = { ( node ) => {
123+ renameInput . current = node ;
124+ handleRenameFocus ( ) ;
125+ } }
120126 />
121127 ) }
122128 </ >
You can’t perform that action at this time.
0 commit comments