Skip to content

Commit 67eeb69

Browse files
authored
Merge branch 'master' into GH-68
2 parents 9639168 + 6a4dad7 commit 67eeb69

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

projects/workflows-creator/src/lib/builder/group/group.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
(mousedown)="handleMouseDown($event)"
198198
(mouseup)="handleMouseUp()"
199199
(mouseleave)="handleMouseLeave($event)"
200+
(keydown)="handleKeyPress($event)"
200201
/>
201202
</div>
202203
</ng-template>

projects/workflows-creator/src/lib/builder/group/group.component.ts

+10
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,16 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
590590
}
591591
}
592592

593+
handleKeyPress(event: any) {
594+
const keyCode = event.which || event.keyCode;
595+
const isDigit = keyCode >= 48 && keyCode <= 57;
596+
const isBackspaceOrDelete = [8, 46].includes(keyCode);
597+
const inputValue = event.target.value;
598+
const isValidInput = /^-?\d*\.?\d*$/.test(inputValue);
599+
if (!(isDigit || isBackspaceOrDelete) || !isValidInput) {
600+
event.preventDefault();
601+
}
602+
}
593603
handleEnterEvent(
594604
callback: any,
595605
node: BpmnNode,

projects/workflows-element/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
"directory": "dist"
1919
},
2020
"hash": "52e16f7339ae099b920d5eba85c8551b9ac2178d0fdb8c34eb6eb6de8aa96685"
21+
2122
}

0 commit comments

Comments
 (0)