8000 Creating annotation does not seem to work when target element is in iframe · Issue #59 · recogito/recogito-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Creating annotation does not seem to work when target element is in iframe #59
Closed
@reckart

Description

@reckart

RecogitoJS seems to be rendering ok when applying it to the contents of an IFRAME. However, selecting text to create an annotation does not seem to be working. Not that in the specific case, RecogitoJS is initialized outside the iframe but then told to annotate an element within the iframe.

Specifically, SelectionHandler.js :: _onMouseUp seems to be obtaining the selection from the wrong document. I.e. it is obtaining the selection from the document outside of the iframe when the selection 5290 that has been made was within the iframe:

_onMouseUp = evt => {
    if (this.isEnabled) {
      const selection = getSelection(); // << e.g. here

Instead, the selection should probably be obtained from the document which owns the target element of the mouse event, e.g. evt.target.ownerDocument.getSelection().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0