From 51ee31b3eb070b2d93f5b5fcadb6d968f87c7231 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 15 May 2018 21:36:43 +0530 Subject: [PATCH] FIX: changing tag group privacy setting was not consistent (#5818) --- .../javascripts/discourse/components/radio-button.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/components/radio-button.js.es6 b/app/assets/javascripts/discourse/components/radio-button.js.es6 index 3004f941068..252f7d7ac4c 100644 --- a/app/assets/javascripts/discourse/components/radio-button.js.es6 +++ b/app/assets/javascripts/discourse/components/radio-button.js.es6 @@ -5,8 +5,12 @@ export default Ember.Component.extend({ type : "radio", attributeBindings : ["name", "type", "value", "checked:checked", "disabled:disabled"], - click: function() { - this.set("selection", this.$().val()); + click() { + const value = this.$().val(); + if (this.get("selection") === value) { + this.set("selection", undefined); + } + this.set("selection", value); }, @computed('value', 'selection')