gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Alpaca not compatible w/ jquery-3.4.0 #705

Open seanvree opened 5 years ago

seanvree commented 5 years ago

I have been using Alpaca with jquery-3.3.1.min, but recently updated to jquery-3.4.0.min When the form loads I get these errors:

jquery.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at V (jquery.min.js:2)
    at Y.set (jquery.min.js:2)
    at De (jquery.min.js:2)
    at Text.setup (jquery.min.js:2)
    at Object.add (jquery.min.js:2)
    at De (jquery.min.js:2)
    at Text.setup (jquery.min.js:2)
    at Object.add (jquery.min.js:2)
    at De (jquery.min.js:2)

image

Any ideas?

ambischof commented 5 years ago

I don't know the solution but I was able to isolate the problem. When it tries to focus the control, the control prop is a jquery selector that has text nodes in it, which jquery 3.4 doesn't handle well.

You can recreate this by doing the following:

$('<span>foo</span>hi<span>bar</span>').focus(function() {})

Here it's creating elements and a text node, and calling focus on it, resulting in that same error.

edit: alternate invocation $($.parseHTML('hi')).focus(_.noop)

Edit 2: FWIW, I created a bug report with jquery https://github.com/jquery/jquery/issues/4397

raviatot commented 5 years ago

in alpacajs, from the below radio templates remove un-neccessary new lines and blank spaces would resolve this issue.

this["HandlebarsPrecompiled"]["web-edit"]["control-radio"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {

seanvree commented 4 years ago

So has this been resolved?

seanvree commented 4 years ago

in alpacajs, from the below radio templates remove un-neccessary new lines and blank spaces would resolve this issue.

this["HandlebarsPrecompiled"]["web-edit"]["control-radio"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {

I'm not sure what you mean @raviatot . Are you saying in the alpaca.min.js file or a template that I'm using?

jabrah commented 4 years ago

Not sure if this is still being tracked, but it seems like this issue was resolved with jQuery 3.5.0+

jasondalycan commented 2 years ago

Same issue. Is there an update?