tinymce / tinymce-vue

Official TinyMCE Vue component
MIT License
2.06k stars 207 forks source link

DOMException: Failed to execute 'querySelectorAll' on 'Document' #332

Closed jShox closed 1 year ago

jShox commented 2 years ago

This is javascript error in browser. In some cases if textarea tag has auto-generated id beginnig with digit number. For example

<textarea id="4jtS5pUBVH8t7lcD__content" class="" placeholder="Content"></textarea>

After this error TinyMCE plugin will not initialized.

Attribute id could begin from digit, this is not an error. But TinyMCE use querySelectorAll method for querying by selector. It could be fixed by changing selector string from '#4jtS5pUBVH8t7lcD__content' to '[id="4jtS5pUBVH8t7lcD__content"]'

In Editor.ts:54 selector: `#${elementId}\`, -> selector: `[id="${elementId}"]`,

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-2998

jscasca commented 1 year ago

I don't quite understand the issue. However, if there was an issue with having a numeric id this should be addressed by #342