Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Uncaught RangeError: Maximum call stack size exceeded #2825

Open
subarachnid opened this issue Oct 23, 2024 · 3 comments
Open

Uncaught RangeError: Maximum call stack size exceeded #2825

subarachnid opened this issue Oct 23, 2024 · 3 comments

Comments

@subarachnid
Copy link

subarachnid commented Oct 23, 2024

This seems to be the same issue as #2814

Demo: https://jsfiddle.net/qs2cL9fk/
Instructions: Place the cursor at the very start of the inputfield and input the number "1".

Demo code:

<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.10-beta.11/jquery.inputmask.min.js" integrity="sha512-kEvhB1jYb2A2VMh3KCB49xB76q0veWA2M+WA/7Jvju9Dy2BaiI4FKC72UhuuxGyb9PzCCsqaahPSKLP1N3hKmw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<input type="text" data-inputmask="'alias': 'mydate'" value="24.10.2024" />
<script>
Inputmask.extendAliases({
	mydate: {
		inputFormat: 'dd.mm.yyyy',
		placeholder: 'TT.MM.JJJJ',
		alias: 'datetime'
	},
});
$(document).ready(function(){
  $(":input").inputmask();
});
</script>

The bug seems to only happen when the inputfield is already filled with a value.

OS: Windows 10
Browser: Chrome 130.0.6723.59
Inputmask version: 5.0.10-beta.11

@melloware
Copy link

melloware commented Oct 24, 2024

We have a similar issue...

Original Bug Report at PrimeFaces: primefaces/primefaces#12770

InputMask: 5.10

Configuration:

{
alias: "datetime",
autoUnmask: false,
clearIncomplete: false,
clearMaskOnLostFocus: false,
inputFormat: "dd\/mm\/yyyy HH:MM:ss",
placeholder: "_",
showMaskOnHover: false,
 }
  1. Click into datePicker input field
  2. Put the cursor at the beginning of the field
  3. Type "12" to try and set the day to 12
  4. Observe the stack trace

CodePen: https://codepen.io/melloware/pen/GRVOERo

Uncaught RangeError: Maximum call stack size exceeded
    at y.h (jquery.inputmask.min.js:8:99582)
    at y.p (jquery.inputmask.min.js:8:99052)
    at y.f (jquery.inputmask.min.js:8:98414)
    at jquery.inputmask.min.js:8:105270
    at y.h (jquery.inputmask.min.js:8:105517)
    at y.p (jquery.inputmask.min.js:8:99052)
    at y.f (jquery.inputmask.min.js:8:98414)
    at jquery.inputmask.min.js:8:105270
    at y.h (jquery.inputmask.min.js:8:105517)
    at y.p (jquery.inputmask.min.js:8:99052)

@vco-80
Copy link

vco-80 commented Feb 26, 2025

Similar issue also here.

InputMask: 5.0.9 but also with 5.0.10-beta.32
CodePen: https://codepen.io/vco8/pen/dPyObjR
Browser: Desktop Chrome 133.0.6943.127, Firefox 135.0. But should not matter what version.

Steps to reproduce:

  1. Open CodePen above
  2. Open js console
  3. Put the cursor at the beginning of the field
  4. Enter 111 and click again at the beginning of the field
  5. Enter fast again 111 or just stay on the 1 key
  6. See "Maximum call stack size exceeded" error in the console (or similar error, depending on the browser)

Seems that this occurs only when using dots in the inputFormat: eg. "dd.mm.yyyy"

Image

@VasilisNikiforidis
Copy link

+1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants