OpenESignForms / vaadin-ckeditor

Vaadin component wrapper around CKEditor
4 stars 11 forks source link

Do not use just a number as HTML element ID for 'v-ckeditortextfield' #69

Closed paulroemer closed 6 years ago

paulroemer commented 7 years ago

We stumbled over a bug if we use the CKEditor with a third party library.

Problem 1: In VCKEditorTextfield you are using the paintablId (paintableId = uidl.getId();) as ID for the div container the ckeditor will be injected into. This is against the HTML specification:

 ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

This alone is not bad as most browsers document.getElementId() allow the usage of numbers.

Problem 2: But if you are forced to use a third-party library that installs its own and more restrictive proxy for that particular function you start wondering why the CKEditor is no longer loaded.

I guess even a simple prefix for the element ID would fix the problem.

Cheers, Paul

OpenESignForms commented 7 years ago

Ah, that's an old, latent bug. We'll try to correct that in the next release bundled with the latest release of the editor itself.

OpenESignForms commented 6 years ago

Fixed to use VCKE_paintableid as the DOM element ID.