diff --git a/CHANGELOG.md b/CHANGELOG.md index f5fc45f..fe0d115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.1] + +### Fixed + +- Fix bug with backspace not updating model + ## [0.9.0] ### Changed diff --git a/src/virtual-keyboard.component.ts b/src/virtual-keyboard.component.ts index da01b9f..6d49583 100644 --- a/src/virtual-keyboard.component.ts +++ b/src/virtual-keyboard.component.ts @@ -74,7 +74,7 @@ export class VirtualKeyboardComponent implements OnInit, OnDestroy { public placeholder: string; public type: string; public disabled: boolean; - public maxLength: number|string; + public maxLength: number | string; private caretPosition: number; private shift = false; @@ -277,6 +277,7 @@ export class VirtualKeyboardComponent implements OnInit, OnDestroy { this.inputElement.nativeElement.value = currentValue.substring(0, currentValue.length - 1); } + this.dispatchEvents(event); // Set focus to keyboard input this.keyboardInput.nativeElement.focus(); break; @@ -312,7 +313,7 @@ export class VirtualKeyboardComponent implements OnInit, OnDestroy { // Simulate all needed events on base element this.inputElement.nativeElement.dispatchEvent(new KeyboardEvent('keydown', eventInit)); this.inputElement.nativeElement.dispatchEvent(new KeyboardEvent('keypress', eventInit)); - this.inputElement.nativeElement.dispatchEvent(new Event('input', {bubbles : true})); + this.inputElement.nativeElement.dispatchEvent(new Event('input', { bubbles: true })); this.inputElement.nativeElement.dispatchEvent(new KeyboardEvent('keyup', eventInit)); // And set focus to input