I have a functionality where I defined custom pattern and it should allow user to enter any alphabets, numbers, spaces and special characters. In this example lets say $
At the same time I have '$' as special character.
When I enter '$', app is behaving so weirdly and value in textbox is getting disturbed totally.
Below is the code for mask, specialCharacters and regex for customPatterns.
Also please check this in stackblitz
mask: string = '$(XX:XXXX)';
maskingSpecialCharacters = ['_', '-', '(', ')', '$', '.', '/'];
public customPatterns = {
// X => Retains as typed.Can take in special characters, numbers, alphabets , spaces
X: { pattern: new RegExp('[a-zA-Z0-9 -$~`!@#%^&*+={}[]|:;"<>,?]') },
};