Skip to content

Commit

Permalink
feat(ui5-time-picker): introduce open and close events (#9093)
Browse files Browse the repository at this point in the history
As we introduced a declaritive property `open` which controls wether the value-help dialog of the `<ui5-timepicker>` is open or not, we are now introducing `open` and `close` events fired **after** the value-help dialog is opened or closed.
  • Loading branch information
hinzzx authored May 31, 2024
1 parent 4e9d668 commit bf2d0aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/main/src/TimePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ type TimePickerInputEventDetail = TimePickerChangeInputEventDetail;
},
},
})
/**
* Fired after the value-help dialog of the component is opened.
* @since 2.0.0
* @public
*/
@event("open")
/**
* Fired after the value-help dialog of the component is closed.
* @since 2.0.0
* @public
*/
@event("close")
class TimePicker extends UI5Element implements IFormInputElement {
/**
* Defines a formatted time value.
Expand Down Expand Up @@ -380,6 +392,11 @@ class TimePicker extends UI5Element implements IFormInputElement {

onResponsivePopoverAfterClose() {
this.open = false;
this.fireEvent("close");
}

onResponsivePopoverAfterOpen() {
this.fireEvent("open");
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/TimePickerPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
_hide-header
hide-arrow
@ui5-close="{{onResponsivePopoverAfterClose}}"
@ui5-open="{{onResponsivePopoverAfterOpen}}"
@wheel="{{_handleWheel}}"
@keydown="{{_onkeydown}}"
>
Expand Down

0 comments on commit bf2d0aa

Please sign in to comment.