File tree 1 file changed +10
-4
lines changed
client/modules/IDE/components/CollectionList
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,6 @@ const CollectionListRowBase = (props) => {
129
129
closeAll ( ) ;
130
130
setRenameOpen ( true ) ;
131
131
setRenameValue ( props . collection . name ) ;
132
- if ( renameInput . current ) {
133
- renameInput . current . focus ( ) ;
134
- }
135
132
} ;
136
133
137
134
const handleRenameChange = ( e ) => {
@@ -146,6 +143,12 @@ const CollectionListRowBase = (props) => {
146
143
}
147
144
} ;
148
145
146
+ const handleRenameFocus = ( ) => {
147
+ if ( renameInput . current ) {
148
+ renameInput . current . focus ( ) ;
149
+ }
150
+ } ;
151
+
149
152
const handleRenameBlur = ( ) => {
150
153
updateName ( ) ;
151
154
closeAll ( ) ;
@@ -191,7 +194,10 @@ const CollectionListRowBase = (props) => {
191
194
onKeyDown = { handleRenameEnter }
192
195
onBlur = { handleRenameBlur }
193
196
onClick = { ( e ) => e . stopPropagation ( ) }
194
- ref = { renameInput }
197
+ ref = { ( node ) => {
198
+ renameInput . current = node ;
199
+ handleRenameFocus ( ) ;
200
+ } }
195
201
/>
196
202
) }
197
203
</ >
You can’t perform that action at this time.
0 commit comments