this.handleChange(e)}
/>
diff --git a/browser/main/Detail/TagSelect.js b/browser/main/Detail/TagSelect.js
index e51d56730..9bfbabbe1 100644
--- a/browser/main/Detail/TagSelect.js
+++ b/browser/main/Detail/TagSelect.js
@@ -82,8 +82,14 @@ class TagSelect extends React.Component {
value = _.isArray(value)
? value.slice()
: []
- value.push(newTag)
- value = _.uniq(value)
+
+ if (!_.includes(value, newTag)) {
+ value.push(newTag)
+ }
+
+ if (this.props.saveTagsAlphabetically) {
+ value = _.sortBy(value)
+ }
this.setState({
newTag: ''
diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js
index 40269190d..a53281bc0 100644
--- a/browser/main/modals/PreferencesModal/UiTab.js
+++ b/browser/main/modals/PreferencesModal/UiTab.js
@@ -71,6 +71,7 @@ class UiTab extends React.Component {
confirmDeletion: this.refs.confirmDeletion.checked,
showOnlyRelatedTags: this.refs.showOnlyRelatedTags.checked,
showTagsAlphabetically: this.refs.showTagsAlphabetically.checked,
+ saveTagsAlphabetically: this.refs.saveTagsAlphabetically.checked,
enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked,
disableDirectWrite: this.refs.uiD2w != null
? this.refs.uiD2w.checked
@@ -244,6 +245,17 @@ class UiTab extends React.Component {
}
Tags
+
+
+
+