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

Support React based editors #123

Closed
asamuzaK opened this issue Jan 8, 2020 · 8 comments
Closed

Support React based editors #123

asamuzaK opened this issue Jan 8, 2020 · 8 comments

Comments

@asamuzaK
Copy link
Owner

asamuzaK commented Jan 8, 2020

See Reviews for withExEditor – Add-ons for Firefox (en-US)

asamuzaK added a commit that referenced this issue Apr 12, 2020
@asamuzaK
Copy link
Owner Author

@asamuzaK
Copy link
Owner Author

Summary of some tests.

dispatch beforeinput event: react does not listen to beforeinput

const dispatchBeforeInputEvent = (elm, value) => {
  const evt = new InputEvent("beforeinput", {
    bubbles: true,
    cancelable: true,
    data: value,
    inputType: "insertText",
  });
  elm.dispatchEvent(evt);
};

dispatch paste event: synthetic paste does not succeed

const dispatchPasteEvent = (elm, value) => {
  const evt = new ClipboardEvent("paste", {
    bubbles: true,
    cancelable: true,
    clipboardData: new DataTransfer(),
  });
  evt.clipboardData.setData("text/plain", value);
  elm.dispatchEvent(evt);
};

dispatch textInput event: permisson error occurs on Firefox

// TextEvent for firefox
(() => {
  if (!window.TextEvent && typeof cloneInto === "function") {
    class TextEvent extends InputEvent {
      constructor(type, opt) {
        super(type, opt);
      }
    }
    window.TextEvent = cloneInto(TextEvent, window, {
      cloneFunctions: true,
      wrapReflectors: true,
    });
  }
})();

const dispatchTextInputEvent = (elm, value) => {
  const evt = new TextEvent("textInput", {
    bubbles: true,
    cancelable: true,
    data: value,
  });
  elm.dispatchEvent(evt);
};

@asamuzaK
Copy link
Owner Author

asamuzaK commented Apr 15, 2020

@asamuzaK asamuzaK changed the title Support Draft.js Support React based editors Apr 26, 2020
asamuzaK added a commit that referenced this issue Jul 19, 2020
Partially fix #123, partially fix #136
@asamuzaK
Copy link
Owner Author

#137 fixed Blink

@asamuzaK
Copy link
Owner Author

Gecko issue is tracked in another issue #138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant