{
btn.focus()
if (!opened) {
opened = true
showPopup(UsersPopup, { _class, title, caption, allowDeselect, selected: value, titleDeselect }, container, (result) => {
if (result === undefined) {
// Value is not changed.
opened = false
return
}
if (result != null) {
value = result._id
dispatch('change', value)
} else {
value = null
selected = undefined
dispatch('change', null)
}
opened = false
})
}
}}
>
{#if selected}{formatName(selected.name)}{:else}{/if}