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) => {
55
55
closeAll ( ) ;
56
56
setRenameOpen ( true ) ;
57
57
setRenameValue ( props . collection . name ) ;
58
- if ( renameInput . current ) {
59
- renameInput . current . focus ( ) ;
60
- }
61
58
} ;
62
59
63
60
const handleRenameChange = ( e ) => {
@@ -71,6 +68,12 @@ const CollectionListRowBase = (props) => {
71
68
}
72
69
} ;
73
70
71
+ const handleRenameFocus = ( ) => {
72
+ if ( renameInput . current ) {
73
+ renameInput . current . focus ( ) ;
74
+ }
75
+ } ;
76
+
74
77
const handleRenameBlur = ( ) => {
75
78
updateName ( ) ;
76
79
closeAll ( ) ;
@@ -116,7 +119,10 @@ const CollectionListRowBase = (props) => {
116
119
onKeyUp = { handleRenameEnter }
117
120
onBlur = { handleRenameBlur }
118
121
onClick = { ( e ) => e . stopPropagation ( ) }
119
- ref = { renameInput }
122
+ ref = { ( node ) => {
123
+ renameInput . current = node ;
124
+ handleRenameFocus ( ) ;
125
+ } }
120
126
/>
121
127
) }
122
128
</ >
You can’t perform that action at this time.
0 commit comments