 
 			input.setCheckChangedValue(v)
 
+			# All keys are selected when user_selectable option is false, otherwise the only ones with values are selected.
+			@__userSelectedData[input.getName()] = not @__user_selectable or (@__user_selectable and not CUI.util.isEmpty(v))
+		return
+
 	setInputVisibility: ->
 		# the "append" re-orders the input, if needed
-
 		names = (key.name for key in @_control.getKeys())
 		# sort input by key
 		@__inputs.sort (a, b) =>

		CUI.Events.listen
			type: "multi-input-control-update"
			node: @__multiInputDiv
			call: (ev) =>
				# console.debug ev.getType(), @__multiInputDiv[0], @_control.getKeys()
				@setInputVisibility()

		# DOM.registerEvent(multiInputDiv, "easydbui-multi-input-control-update")
		# multiInputDiv.on "easydbui-multi-input-control-update", (ev)

		@__inputs = []


				undo_support: false
				content_size: @_content_size
				placeholder: @_placeholder?[key.name]
				onDataInit: (field, data) =>
					if @__user_selectable and CUI.util.isEmpty(data[field.getName()])
						field.hide()
					return

			input = new CUI.MultiInputInput(input_opts)
			input.render()

			do (input, key) =>
				button = new CUI.defaults.class.Button
					text: key.tag
					tabindex: null
					disabled: not @_control.hasUserControl() and not @__user_selectable
					role: "multi-input-tag"
					class: "cui-multi-input-tag-button"
					tooltip: key.tooltip
					onClick: (ev) =>
						if @__user_selectable
							form.reload()
							userSelectablePopover.show()
						else
							@_control.showUserControl(ev, button, @__multiInputDiv)

				form = new CUI.Form
					data: @__userSelectedData
					fields: =>
						fields = @_control.getKeys().map((key) =>
							type: CUI.Checkbox
							name: key.name
							text: key.tooltip.text
							onDataChanged: (data, field) =>
								if Object.values(@__userSelectedData).some((val) -> val)
									return
								data[field.getName()] = true
								field.reload()
						)
						return fields
					onDataChanged: =>
						@setInputVisibility()
				form.start()

				userSelectablePopover = new CUI.Popover
					pane:
						padded: true
						content: form
					element: button

				input.append(button, "right")

				CUI.Events.listen
					type: "data-changed"
