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

Trigger input event after updating textarea #87

Merged

Conversation

MaxGyver83
Copy link
Contributor

@MaxGyver83 MaxGyver83 commented Jan 8, 2023

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

@jlebon
Copy link
Owner

jlebon commented Mar 12, 2023

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

@MaxGyver83
Copy link
Contributor Author

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
Copy link
Contributor Author

But here it works also in the GitHub comment textbox.

@MaxGyver83
Copy link
Contributor Author

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
Copy link
Owner

jlebon commented Mar 12, 2023

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
Copy link
Contributor Author

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
Copy link
Owner

jlebon commented Mar 12, 2023

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

@MaxGyver83 MaxGyver83 force-pushed the trigger-input-event-after-updating-textarea branch from 4e3a59e to 0f5f7c7 Compare March 12, 2023 21:24
@MaxGyver83
Copy link
Contributor Author

No problem. Done!

Copy link
Owner

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

@jlebon jlebon merged commit 30d0e95 into jlebon:master Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants