Fix quick add did not always work the second time

This commit is contained in:
nathan 2023-09-19 13:53:15 -06:00
parent cb484c8f6c
commit 36f42f77db
7 changed files with 31 additions and 2 deletions

View File

@ -807,8 +807,10 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
return html``;
}
return html`
<sl-option value=""
.selected=${this.getValueAsArray().some(v => v == "")}
<sl-option
part="emptyLabel"
value=""
.selected=${this.getValueAsArray().some(v => v == "")}
>
${this.emptyLabel}
</sl-option>`;

View File

@ -515,6 +515,8 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
const parent = document.getElementById(_parent);
const select = document.createElement('et2-select');
select.setAttribute('id', 'quick_add_selectbox');
// Empty label is required to clear value, but we hide it
select.emptyLabel = "Select";
select.placement = "bottom end";
parent.append(select);
const plus = parent.querySelector("span");

View File

@ -5613,6 +5613,11 @@ div.timesheet_timer {
#egw_fw_topmenu_info_items #topmenu_info_timer #timer_selectbox sl-option {
white-space: nowrap;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(emptyLabel),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(emptyLabel) {
/* do NOT show empty label, required for clearing value */
display: none;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_quick_add #timer_selectbox::part(form-control-input),

View File

@ -5593,6 +5593,11 @@ div.timesheet_timer {
#egw_fw_topmenu_info_items #topmenu_info_timer #timer_selectbox sl-option {
white-space: nowrap;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(emptyLabel),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(emptyLabel) {
/* do NOT show empty label, required for clearing value */
display: none;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_quick_add #timer_selectbox::part(form-control-input),

View File

@ -5603,6 +5603,11 @@ div.timesheet_timer {
#egw_fw_topmenu_info_items #topmenu_info_timer #timer_selectbox sl-option {
white-space: nowrap;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(emptyLabel),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(emptyLabel) {
/* do NOT show empty label, required for clearing value */
display: none;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_quick_add #timer_selectbox::part(form-control-input),

View File

@ -298,6 +298,11 @@ div.timesheet_timer {
}
}
#quick_add_selectbox::part(emptyLabel) {
/* do NOT show empty label, required for clearing value */
display: none;
}
#quick_add_selectbox::part(form-control-input), #timer_selectbox::part(form-control-input) {
border: none !important;
}

View File

@ -5624,6 +5624,11 @@ div.timesheet_timer {
#egw_fw_topmenu_info_items #topmenu_info_timer #timer_selectbox sl-option {
white-space: nowrap;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(emptyLabel),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(emptyLabel) {
/* do NOT show empty label, required for clearing value */
display: none;
}
#egw_fw_topmenu_info_items #topmenu_info_quick_add #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_timer #quick_add_selectbox::part(form-control-input),
#egw_fw_topmenu_info_items #topmenu_info_quick_add #timer_selectbox::part(form-control-input),