I have been using regex pattern for some Lightning input field in LWC and also provided 'message-when-pattern-mismatch' error message.
regex is like : pattern="[a-zA-Z-]+"
As per the pattern, input field will only accept alphabet in lowercase, uppercase and hyphen. But if I provide any special character or number then instead of showing error in the UI, its showing error in the console.
Again if I modify the regex like pattern="[a-zA-Z\-]+"
Now it shows pattern mismatch error in the UI.
Does anyone have any idea why it's happening suddenly? Previously it was working fine.
\\-