Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/angular-keyboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@taskbase/angular-keyboard",
"version": "0.0.7",
"version": "0.0.8",
"peerDependencies": {
"@angular/common": "^8.1.3",
"@angular/core": "^8.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ export class KeyboardContainerComponent implements OnInit, OnDestroy {

onClickOnPage(e) {
const isFakeInput = this.angularKeyboardService.inputFields
.map(fakeInputElt => isAncestor(e.target, fakeInputElt.nativeElement))
.map(fakeInputElt => {
try {
// Check if the fake input element is an ancestor of the clicked element
return isAncestor(e.target, fakeInputElt.nativeElement);
} catch {
// It is possible that the clicked element is already not present anymore in the DOM, then isAncestor throws an error.
// In this case assume a click outside to close the keyboard
return false;
}
})
.reduce((a, b) => a || b, false);
if (isFakeInput) {
// don't blur
Expand Down