Skip to content

Commit 9ffba10

Browse files
committed
fix: remove double click to rename feature as its bad ux
1 parent d94256b commit 9ffba10

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

src/project/FileTreeView.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,7 @@ define(function (require, exports, module) {
497497
* Ensures that we always have a state object.
498498
*/
499499
getInitialState: function () {
500-
return {
501-
clickTimer: null
502-
};
500+
return {};
503501
},
504502

505503
/**
@@ -527,25 +525,13 @@ define(function (require, exports, module) {
527525
// project-files-container and then the file tree will be one self-contained
528526
// functional unit.
529527
ViewUtils.scrollElementIntoView($("#project-files-container"), $(Preact.findDOMNode(this)), true);
530-
} else if (!isSelected && wasSelected && this.state.clickTimer !== null) {
531-
this.clearTimer();
532-
}
533-
},
534-
535-
clearTimer: function () {
536-
if (this.state.clickTimer !== null) {
537-
window.clearTimeout(this.state.clickTimer);
538-
this.setState({
539-
clickTimer: null
540-
});
541528
}
542529
},
543530

544531
startRename: function () {
545532
if (!this.props.entry.get("rename")) {
546533
this.props.actions.startRename(this.myPath());
547534
}
548-
this.clearTimer();
549535
},
550536

551537
/**
@@ -563,14 +549,7 @@ define(function (require, exports, module) {
563549
return;
564550
}
565551

566-
if (this.props.entry.get("selected") && !e.ctrlKey) {
567-
if (this.state.clickTimer === null && !this.props.entry.get("rename")) {
568-
var timer = window.setTimeout(this.startRename, CLICK_RENAME_MINIMUM);
569-
this.setState({
570-
clickTimer: timer
571-
});
572-
}
573-
} else {
552+
if (!(this.props.entry.get("selected") && !e.ctrlKey)) {
574553
var language = LanguageManager.getLanguageForPath(this.myPath()),
575554
doNotOpen = false;
576555
if (language && language.isBinary() && "image" !== language.getId() &&
@@ -614,9 +593,6 @@ define(function (require, exports, module) {
614593
*/
615594
handleDoubleClick: function () {
616595
if (!this.props.entry.get("rename")) {
617-
if (this.state.clickTimer !== null) {
618-
this.clearTimer();
619-
}
620596
if (FileUtils.shouldOpenInExternalApplication(
621597
FileUtils.getFileExtension(this.myPath()).toLowerCase()
622598
)) {

0 commit comments

Comments
 (0)