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

Patch js script #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

robert8888
Copy link

According to documentation we can change 'subwidget_form' to any build in or custom widget. 
This option doesn't work because line 29-32 in querySelector hardcore looking for input field, and don't have any protection in case when it doesn't find it, so script throws error when it's trying getAttribute('id) on undefined variable in case when we're using textarea. 

I change this to finding tag of first element (select, input , textarea)  and then using it to  next calls.

and i updated min. version.

(i made it because it doesn't work with textarea because of this script)

According to documentation we can change 'subwidget_form' to any build in or custom widget. 
This option doesn't work because line 29-32 in querySelector is hardcoded looking for input field, and don't have any protection in case when it doesn't find it, so script throws error when it's trying getAttribute('id) on undefined variable in case when we're using textarea. 

I change this to finding tag of first element and then using it to next querySelector calls.
(I test this with inputs and textareas ans selects and it works ok)

Now it works with all kids of input (like it was) textarea and selects.
minification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant