Calendar: Fix some webcomponent sidebox / filter issues

- category could not be cleared
- webcomponents did not always reflect state values
This commit is contained in:
nathan 2022-07-25 11:11:51 -06:00
parent ab9cde60eb
commit 1a4badfabd
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,6 @@ import {et2_button} from "../../api/js/etemplate/et2_widget_button";
import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox"; import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
import {et2_widget} from "../../api/js/etemplate/et2_core_widget"; import {et2_widget} from "../../api/js/etemplate/et2_core_widget";
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch"; import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
import {et2_inputWidget} from "../../api/js/etemplate/et2_core_inputWidget";
import {et2_iframe} from "../../api/js/etemplate/et2_widget_iframe"; import {et2_iframe} from "../../api/js/etemplate/et2_widget_iframe";
// @ts-ignore // @ts-ignore
import {date} from "../../api/js/etemplate/lib/date.js"; import {date} from "../../api/js/etemplate/lib/date.js";
@ -56,6 +55,7 @@ import flatpickr from "flatpickr";
import Sortable from 'sortablejs/modular/sortable.complete.esm.js'; import Sortable from 'sortablejs/modular/sortable.complete.esm.js';
import {tapAndSwipe} from "../../api/js/tapandswipe"; import {tapAndSwipe} from "../../api/js/tapandswipe";
import {CalendarOwner} from "./CalendarOwner"; import {CalendarOwner} from "./CalendarOwner";
import {et2_IInput} from "../../api/js/etemplate/et2_core_interfaces";
/** /**
* UI for calendar * UI for calendar
@ -3226,12 +3226,12 @@ export class CalendarApp extends EgwApp
widget.set_value(''); widget.set_value('');
} }
} }
else if (widget.instanceOf(et2_inputWidget) && typeof state.state[widget.id] == 'undefined') else if(typeof widget.set_value == "function" && typeof state.state[widget.id] == 'undefined')
{ {
// No value, clear it // No value, clear it
widget.set_value(''); widget.set_value('');
} }
},this,et2_valueWidget); }, this, et2_IInput);
} }
} }

View File

@ -31,7 +31,7 @@ return false;"/>
<textbox type="hidden" id="first"/> <textbox type="hidden" id="first"/>
<textbox type="hidden" id="last"/> <textbox type="hidden" id="last"/>
<hrule/> <hrule/>
<select-cat id="cat_id" placeholder="All categories" <select-cat id="cat_id" placeholder="All categories" empty_label="All categories"
onchange="app.calendar.update_state({cat_id: widget.getValue()});"/> onchange="app.calendar.update_state({cat_id: widget.getValue()});"/>
<select id="status_filter" no_lang="true" class="et2_fullWidth" <select id="status_filter" no_lang="true" class="et2_fullWidth"
onchange="app.calendar.update_state({status_filter: widget.getValue()});"/> onchange="app.calendar.update_state({status_filter: widget.getValue()});"/>