Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

JSON Form may crash when applied to elements not yet inserted in the DOM #14

Closed
tidoust opened this issue Sep 24, 2012 · 0 comments
Closed
Labels

Comments

@tidoust
Copy link
Contributor

tidoust commented Sep 24, 2012

Code that enhance generated fields sometimes uses global selectors such as $(id), where id is an element generated by the underlying field. This works well provided the form element is in the DOM. However, JSON Form may very well be applied to an element that has not yet been inserted in the DOM (e.g. to prepare a view before rendering).

All selections in JSON Form should rather be scoped to node.el to guarantee that they parse the right subtree, no matter whether it is in the main DOM tree or not.

Similarly, the ACE editor receives "node.id" + "__ace" as initialization parameter. Internally, the ACE library uses getElementById to retrieve the element, which fails when the element is not yet in the DOM tree. The ACE editor should rather receive the element directly.

tidoust pushed a commit that referenced this issue Sep 24, 2012
Commit also includes a typo fix for maxLength.
@tidoust tidoust closed this as completed Sep 24, 2012
pombredanne pushed a commit to pombredanne/jsonform that referenced this issue Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant