Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.77k stars 722 forks source link

RangeError: Maximum call stack size exceeded #734

Open AnReZa opened 5 years ago

AnReZa commented 5 years ago

This might be related to #542: I use your on-screen keyboard in combination with DataTables. I want to enable the user to enter a search string into DataTable's default search box.

DataTables uses the keyUp event to trigger the search. After some research on the web, I found a how-to article which described, that I should modify the following property:

$.keyboard.events.kbChange = 'keyup';

I use the following code to bind your keyboard to the field:

let $searchField = $('#main-table_filter input[type="search"]');
$searchField.keyboard({
  layout: "german-qwertz-1",
  stickyShift: false,
  usePreview: false
});

This throws me the following JavaScript error on every click on a virtual key:

Uncaught RangeError: Maximum call stack size exceeded at String.replace () at G (jquery-3.3.1.min.js:2) at Q.get (jquery-3.3.1.min.js:2) at HTMLInputElement.dispatch (jquery-3.3.1.min.js:2) at HTMLInputElement.y.handle (jquery-3.3.1.min.js:2) at Object.trigger (jquery-3.3.1.min.js:2) at HTMLInputElement. (jquery-3.3.1.min.js:2) at Function.each (jquery-3.3.1.min.js:2) at w.fn.init.each (jquery-3.3.1.min.js:2) at w.fn.init.trigger (jquery-3.3.1.min.js:2)

Is there a way to prevent this from happening? The functionality works as expected, but the browser freezes after every key press for about half a second, which is not very pleasing.

Mottie commented 5 years ago

Hi @AnReZa!

Sorry for the long delay. I'll look into this and see what I can do.