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 @@ -129,9 +129,6 @@ const CollectionListRowBase = (props) => {
129129 closeAll ( ) ;
130130 setRenameOpen ( true ) ;
131131 setRenameValue ( props . collection . name ) ;
132- if ( renameInput . current ) {
133- renameInput . current . focus ( ) ;
134- }
135132 } ;
136133
137134 const handleRenameChange = ( e ) => {
@@ -146,6 +143,12 @@ const CollectionListRowBase = (props) => {
146143 }
147144 } ;
148145
146+ const handleRenameFocus = ( ) => {
147+ if ( renameInput . current ) {
148+ renameInput . current . focus ( ) ;
149+ }
150+ } ;
151+
149152 const handleRenameBlur = ( ) => {
150153 updateName ( ) ;
151154 closeAll ( ) ;
@@ -191,7 +194,10 @@ const CollectionListRowBase = (props) => {
191194 onKeyDown = { handleRenameEnter }
192195 onBlur = { handleRenameBlur }
193196 onClick = { ( e ) => e . stopPropagation ( ) }
194- ref = { renameInput }
197+ ref = { ( node ) => {
198+ renameInput . current = node ;
199+ handleRenameFocus ( ) ;
200+ } }
195201 />
196202 ) }
197203 </ >
You can’t perform that action at this time.
0 commit comments