Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected filterNumber(e: KeyboardEvent, type: ColumnType): void {
- if (type === ColumnType.number) {
- const key = e.key;
- if (key.length === 1 || e.code === 'KeyV' && e.ctrlKey) {
- if (/[^0-9]/.test(key) && !['.', ',', '-'].includes(key)) {
- return e.preventDefault();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment