Closed ltazmin closed 9 years ago
There will likely be issues with the selection when working with multiple scribe instances. Do you get an error when you use more than one or does it just not work?
I believe that we are having issues with some event propagation with multiple Scribe instances but we do have pages that run multiple Scribe instances so it is possible for the bulk of the core functionality.
cc @cutandpastey
Yeah, you used to be able to register multiple identical event handlers in src/event-emitter
but thats not such a big deal (and has been fixed, see: https://github.com/guardian/scribe/pull/328).
Also multiple scribe instance used to have a place markers bug, for example if you have three instances and a collapsed selection within a given scribe element, when Selection.placeMarkers
was called you would get three <em class='scribe-marker'></em>
. This was fixed in https://github.com/guardian/scribe/pull/324 but leads to https://github.com/guardian/scribe/issues/329 which might be effecting you.
What I can tell you is that it is totally possible to have multiple instances of Scribe on a page, @hmgibson23 and @robinedman might be able to let you know about some implementation details, but it would be best to:
If we get these we should be able to help out.
I've created a FAQ in the Scribe wiki with the short answer for the this.
Thanks for asking @ltazmin
Since Scribe can't accept multiple elements: (i.e
var scribe = new Scribe(document.querySelectorAll('.scribe'));
)We tried to create multiple instances for each field instead, but there seems to be a problem with one interfering with the other. For example:
Is this a known issue or is it actually possible to create multiple instances of Scribe (If so, how)?