From 7bf544c28a408b628de4a7587a98e4be7c636dac Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 9 Apr 2018 10:48:21 -0400 Subject: [PATCH] Don't click cycle through `alternating` or `reversible` oneway states (closes #4970) They are still supported as translated strings, and user can still enter these values in the raw tag editor, but they should not toggle with clicks in the checkbox field. This is because novice users are confused by what they mean. --- modules/ui/fields/check.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ui/fields/check.js b/modules/ui/fields/check.js index f7300c598..945085aa0 100644 --- a/modules/ui/fields/check.js +++ b/modules/ui/fields/check.js @@ -126,10 +126,17 @@ export function uiFieldCheck(field, context) { input .on('click', function() { + d3_event.stopPropagation(); var t = {}; t[field.key] = values[(values.indexOf(_value) + 1) % values.length]; + + // Don't cycle through `alternating` or `reversible` states - #4970 + // (They are supported as translated strings, but should not toggle with clicks) + if (t[field.key] === 'reversible' || t[field.key] === 'alternating') { + t[field.key] = values[0]; + } + dispatch.call('change', this, t); - d3_event.stopPropagation(); }); if (field.type === 'onewayCheck') {