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

Dynamicly creation option elements breaks when value contain spaces #14

Open
AforDesign opened this issue Dec 9, 2022 · 0 comments
Open

Comments

@AforDesign
Copy link

When option elements are created dynamicly, the values need to be encapsulated.
Right now, this is not the case, resulting in broken html when values contain spaces.

To fix this, change:

                document.getElementById(this.selector).insertAdjacentHTML('beforeend',
                    "<option "+change_img+" "+change_icon+" "+change_separator+" "+change_disabled+" value="+properties.options[i].value+" >"+properties.options[i].inner_text+"</option>");

To:

                document.getElementById(this.selector).insertAdjacentHTML('beforeend',
                    "<option "+change_img+" "+change_icon+" "+change_separator+" "+change_disabled+" value=\""+properties.options[i].value+"\" >"+properties.options[i].inner_text+"</option>");
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

No branches or pull requests

1 participant