Skip to content

Commit f055564

Browse files
committed
code clean up
1 parent 66bca4e commit f055564

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/core.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function getInputElement(el: HTMLElement | HTMLInputElement): CustomInput
6565

6666
/* istanbul ignore next */
6767
if (!inputElement) {
68-
throw new Error('facade directive requires an input element')
68+
throw new Error('number directive requires an input element')
6969
}
7070

7171
return inputElement as CustomInputElement
@@ -149,7 +149,7 @@ export function inputHandler(event: CustomInputEvent) {
149149
positionFromEnd = target.value.length - target.selectionEnd
150150
}
151151

152-
updateValue(target, null, { emit: false, clean: !options.precision })
152+
updateValue(target, null, { clean: !options.precision })
153153

154154
// updated cursor position
155155
if (options.suffix) {
@@ -172,12 +172,11 @@ export function inputHandler(event: CustomInputEvent) {
172172
* @param {Event} event The event object
173173
*/
174174
export function blurHandler(event: Event) {
175-
const { target, detail } = event as CustomInputEvent
175+
const { target } = event as CustomInputEvent
176176

177-
// We dont need to run this method on the event we emit (prevent event loop)
178-
if (detail?.facade) {
179-
return false
180-
}
177+
// since we will be emitting our own custom input event
178+
// we can stop propagation of this native event
179+
event.stopPropagation()
181180

182181
const { oldValue } = target
183182

0 commit comments

Comments
 (0)