-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix #2641: Input field change to blank after double click F2 to rename the file - few user will encounter #3299
Conversation
Assigned @gruehle |
Would it be better to just check |
I didn't saw that function before. It should work to fix this too. |
@@ -1272,6 +1272,11 @@ define(function (require, exports, module) { | |||
// First make sure the item in the tree is visible - jsTree's rename API doesn't do anything to ensure inline input is visible | |||
showInTree(entry) | |||
.done(function (selected) { | |||
// Don't try to rename again if we are already renaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go at the top of the function, before the call to showInTree()
. There is no real harm in calling showInTree()
, but it is not necessary since the item will be visible if it is being renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Initial review complete. It works as advertised, but the |
@@ -1302,6 +1302,11 @@ define(function (require, exports, module) { | |||
* @param {!Entry} entry FileEntry or DirectoryEntry to rename | |||
*/ | |||
function renameItemInline(entry) { | |||
// Don't try to rename again if we are already renaming | |||
if (_isInRename(entry)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _isInRename()
function is expecting a DOM element, but entry
is a FileEntry
. You'll need to get the selected DOM element here.
It may just be easiest to put the code back where it was... Sorry about that! :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It's ok. I did a fast test and it worked, so I submitted the change, but I might have been using the old version even after reloading the second window.
Thanks! Merging. |
Fix #2641: Input field change to blank after double click F2 to rename the file - few user will encounter
This adds a renaming flag, so that when F2 is pressed for the second time, the code does nothing, leaving the renaming as it was, which fixes issue #2641.