JQuery .mask doesn’t allow more than 6 digits

I’m trying to add dots to separate thounsands in html input tags of type number. It works only for numbers of 6 digits, after adding one more digit to the input, the number disapears.

Here is the code

js

$(document).on("change", 'input[type="number"]', function () {
    const inputSelectors = $('input[type="number"]')
    inputSelectors.mask("000.000.000.000.000.000", {reverse: true});
    
})

html

<input class="detail-input" name="detail-unit-price" type="number" step="any" value="0" required>

I’ve tried commenting every other javascript line to make sure that the problem is related only to this method and the problem persists. If I omit the .mask() method, everythong works perfectly.