Skip to content

Commit c3bcc1e

Browse files
ChriJChristoffer Johansson
andauthored
Send event for outer components to know open status (#1101)
Co-authored-by: Christoffer Johansson <christoffer.johansson@pax2pay.com>
1 parent bed352d commit c3bcc1e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,7 @@ declare global {
17761776
"smoothlyInputLoad": (parent: Editable) => void;
17771777
"smoothlyFormDisable": (disabled: boolean) => void;
17781778
"smoothlyItemSelect": HTMLSmoothlyItemElement;
1779+
"smoothlySelectOpen": boolean;
17791780
}
17801781
interface HTMLSmoothlyInputSelectElement extends Components.SmoothlyInputSelect, HTMLStencilElement {
17811782
addEventListener<K extends keyof HTMLSmoothlyInputSelectElementEventMap>(type: K, listener: (this: HTMLSmoothlyInputSelectElement, ev: SmoothlyInputSelectCustomEvent<HTMLSmoothlyInputSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -2845,6 +2846,7 @@ declare namespace LocalJSX {
28452846
"onSmoothlyInputLoad"?: (event: SmoothlyInputSelectCustomEvent<(parent: Editable) => void>) => void;
28462847
"onSmoothlyInputLooks"?: (event: SmoothlyInputSelectCustomEvent<(looks?: Looks, color?: Color) => void>) => void;
28472848
"onSmoothlyItemSelect"?: (event: SmoothlyInputSelectCustomEvent<HTMLSmoothlyItemElement>) => void;
2849+
"onSmoothlySelectOpen"?: (event: SmoothlyInputSelectCustomEvent<boolean>) => void;
28482850
"onSmoothlyUserInput"?: (event: SmoothlyInputSelectCustomEvent<Input.UserInput>) => void;
28492851
"ordered"?: boolean;
28502852
"placeholder"?: string | any;

src/components/input/select/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class SmoothlyInputSelect implements Input, Editable, Clearable, Componen
6868
@Event() smoothlyInputLoad: EventEmitter<(parent: Editable) => void>
6969
@Event() smoothlyFormDisable: EventEmitter<(disabled: boolean) => void>
7070
@Event() smoothlyItemSelect: EventEmitter<HTMLSmoothlyItemElement>
71+
@Event() smoothlySelectOpen: EventEmitter<boolean>
7172

7273
componentWillLoad(): void | Promise<void> {
7374
this.smoothlyInputLooks.emit(
@@ -231,6 +232,7 @@ export class SmoothlyInputSelect implements Input, Editable, Clearable, Componen
231232
markedItem.marked = false
232233
}
233234
}
235+
this.smoothlySelectOpen.emit(open)
234236
}
235237
handleShowOptions(event?: Event): void {
236238
const wasButtonClicked =

0 commit comments

Comments
 (0)