diff --git a/core/src/components/cat-dropdown/cat-dropdown.tsx b/core/src/components/cat-dropdown/cat-dropdown.tsx index c411389c..48336bf4 100644 --- a/core/src/components/cat-dropdown/cat-dropdown.tsx +++ b/core/src/components/cat-dropdown/cat-dropdown.tsx @@ -106,7 +106,6 @@ export class CatDropdown { this.isOpen = true; this.content.classList.add('show'); this.trigger?.setAttribute('aria-expanded', 'true'); - this.catOpen.emit(); this.trap = this.trap ? this.trap.updateContainerElements(this.content) : focusTrap.createFocusTrap(this.content, { @@ -121,6 +120,7 @@ export class CatDropdown { // check if click was not on an element marked with data-dropdown-no-close !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close')), onPostDeactivate: () => this.close(), + onPostActivate: () => this.catOpen.emit(), setReturnFocus: elem => this.trigger || elem, isKeyForward: event => { if (!this.noKeybindings && event.key === 'ArrowDown') { diff --git a/core/src/components/cat-time/cat-time.tsx b/core/src/components/cat-time/cat-time.tsx index 5e6bef59..4f248c3a 100644 --- a/core/src/components/cat-time/cat-time.tsx +++ b/core/src/components/cat-time/cat-time.tsx @@ -199,7 +199,7 @@ export class CatTime { setTimeout(() => { (elem2 ?? elem1)?.doFocus(); (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined); - }, 1); // not entirely sure why this is necessary + }); // not entirely sure why this is necessary } /** @@ -222,7 +222,7 @@ export class CatTime { // we need to set the input explicitly to sync the input even without a // rerender (if the value is not changed) if (this.input) { - this.input.value = this.value ?? ''; + this.input.value = this.format(this.selectionTime, false); } if (oldValue !== this.value) { this.catChange.emit(this.value);