Skip to content

Commit

Permalink
fix: wrong time formatting in new time picker
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Mar 30, 2024
1 parent 111d872 commit 9a81f85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/components/cat-dropdown/cat-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/cat-time/cat-time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand All @@ -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);
Expand Down

0 comments on commit 9a81f85

Please sign in to comment.