The numeric textbox has a “max” property. If you set it to 9999 and the user enters a larger number, the value will automatically reduce to 9999 when the user leaves the field.
If you want to fully disable entering more than 4 characters you can set: document.querySelector(‘smart-numeric-text-box input’).setAttribute(‘maxlength’, 4)