diff --git a/modules/ui/fields/radio.js b/modules/ui/fields/radio.js index aeb552b76..27c8175b3 100644 --- a/modules/ui/fields/radio.js +++ b/modules/ui/fields/radio.js @@ -203,10 +203,22 @@ export function uiFieldRadio(field, context) { } if (field.type === 'structureRadio') { - if (val === 'no' || (key !== 'bridge' && key !== 'tunnel')) { + // remove layer if it should not be set + if (val === 'no' || + (key !== 'bridge' && key !== 'tunnel') || + (key === 'tunnel' && val === 'building_passage')) { t.layer = undefined; } - } + // add layer if it should be set + if (t.layer === undefined) { + if (key === 'bridge' && val !== 'no') { + t.layer = '1'; + } + if (key === 'tunnel' && val !== 'no' && val !== 'building_passage') { + t.layer = '-1'; + } + } + } dispatch.call('change', this, t, onInput); } @@ -243,7 +255,7 @@ export function uiFieldRadio(field, context) { if (field.type === 'structureRadio') { if (activeKey === 'bridge') { t.layer = '1'; - } else if (activeKey === 'tunnel') { + } else if (activeKey === 'tunnel' && t.tunnel !== 'building_passage') { t.layer = '-1'; } else { t.layer = undefined;