From 152c1bfb8468f6266d2a3f51bd6273b463f331e4 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Sun, 19 Nov 2023 00:54:53 +0100 Subject: [PATCH] fix the type of `input` from `fun` or `onEdit` to `HTMLInputElement|HTMLSelectElement` --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d99956c..acf3e57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for malle +## 2.5.1 + +* Fix the type of `input` from `fun` or `onEdit` to `HTMLInputElement|HTMLSelectElement` + ## 2.5.0 * Create a new instance of Malle for each element (PR #8). This allows opening multiple inputs at the same time. fix #4 diff --git a/package-lock.json b/package-lock.json index 7931054..8932e60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@deltablot/malle", - "version": "2.5.0", + "version": "2.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@deltablot/malle", - "version": "2.5.0", + "version": "2.5.1", "license": "MIT", "devDependencies": { "@types/jest": "^27.4.1", diff --git a/package.json b/package.json index 83c04ca..77b07ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deltablot/malle", - "version": "2.5.0", + "version": "2.5.1", "description": "Make text elements malleable, without dependencies.", "main": "dist/main.js", "typings": "dist/main.d.ts", diff --git a/src/main.ts b/src/main.ts index 451c6db..d9aa73f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,11 +47,11 @@ export interface Options { event?: EventType; inputType?: InputType; focus?: boolean; - fun(value: string, original: HTMLElement, event:Event, input: HTMLInputElement): Promise; + fun(value: string, original: HTMLElement, event:Event, input: HTMLInputElement|HTMLSelectElement): Promise; listenNow?: boolean; listenOn?: string; onBlur?: Action; - onEdit?(original: HTMLElement, event:Event, input: HTMLInputElement): boolean; + onEdit?(original: HTMLElement, event:Event, input: HTMLInputElement|HTMLSelectElement): boolean; onEnter?: Action; onEscape?: Action; placeholder?: string;