jlebon / textern

A Firefox add-on for editing text in your favourite external editor!
GNU General Public License v3.0
138 stars 21 forks source link

Trigger input event after updating textarea #87

Closed MaxGyver83 closed 1 year ago

MaxGyver83 commented 1 year ago

Trigger input event after updating a textarea with textern to make website aware of changed text. This is necessary on https://tiddlywiki.com.

jlebon commented 1 year ago

Hmm, testing in a GitHub textbox, this doesn't really seem to fix it for me. On what website did you test this?

MaxGyver83 commented 1 year ago

I have tested this on https://tiddlywiki.com:

  1. Click on the "+" icon ("Create a new tiddler") in the panel on the right side.
  2. Click on the "eye" icon ("Show preview pane").
  3. Enter some text in the large textedit field.
  4. Activate textern.
  5. Add more text.
  6. Close textern. The new text shows up in the preview pane.
MaxGyver83 commented 1 year ago

But here it works also in the GitHub comment textbox.

MaxGyver83 commented 1 year ago

In case there are different ways of testing: I have opened about:debugging, clicked on "This Firefox", then "Load Temporary Add-on...", selected ~/repos/textern/webex/ and then tested it.

jlebon commented 1 year ago

The GitHub issue mentioned in #60 is slightly different. Starting Textern on a blank textarea and saving some text doesn't enable the "Comment" button until additional edits are made. Ideally we have something that fixes that too. In some quick tests, I played around with variations of that code and e.g. e.dispatchEvent(new KeyboardEvent("keydown", { key: " ", code: "Space" }));, but that doesn't do the trick.

MaxGyver83 commented 1 year ago

Oh, yes, you are right about the "Comment" button. So far, I couldn't find a way to enable it.

But you could merge this anyway as it fixes my issue in TiddlyWiki. (And maybe for other web pages, too.)

jlebon commented 1 year ago

WFM. Can you add a short comment explaining the line, and drop the fixes marker for #60?

MaxGyver83 commented 1 year ago

No problem. Done!