request update when inputType is updated to rerender

This commit is contained in:
Mads Rasmussen
2023-03-09 13:12:58 +01:00
parent 4be014754f
commit f06094d89f
2 changed files with 4 additions and 1 deletions

View File

@@ -49,6 +49,8 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement {
@property({ type: Array, attribute: false })
public set config(config: Array<PropertyEditorConfigDefaultData>) {
const oldVal = this._inputType;
// Format string prevalue/config
this._format = config.find((x) => x.alias === 'format')?.value;
const pickTime = this._format?.includes('H') || this._format?.includes('m');
@@ -67,6 +69,8 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement {
// TODO: Warren - Need to deal with offSetTime prevalue/config
// Currently the date picker in uui-iinput does not change based on this config
this._offsetTime = config.find((x) => x.alias === 'offsetTime')?.value;
this.requestUpdate('_inputType', oldVal);
}
render() {

View File

@@ -10,7 +10,6 @@ describe('UmbPropertyEditorUIDatePickerElement', () => {
beforeEach(async () => {
element = await fixture(html` <umb-property-editor-ui-date-picker></umb-property-editor-ui-date-picker> `);
inputElement = element.shadowRoot?.querySelector('uui-input') as UUIInputElement;
console.log(element);
});
it('is defined with its own instance', () => {