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

Does not work in textareas in TiddlyWiki #56

Closed MaxGyver83 closed 4 years ago

MaxGyver83 commented 4 years ago

textern does not work in TiddlyWiki textareas. How to reproduce:

  1. Go to https://tiddlywiki.com
  2. Click on the + button (Create a new tiddler) on the right side panel. This opens a new div with 5 inputs and a large textarea.
  3. Click into the textarea.
  4. Use your textern shortcut.
  5. Nothing happens.
MaxGyver83 commented 4 years ago

I have tried to find the reason for this issue.

When I enter text into one of the inputs, I get values like those in shortcut.js:

When I enter text into the textarea, I get:

keyCode doesn't get updated in the textarea, no matter which key I press.

Then I changed

e = e || window.event;

to

e = window.event || e;

Then e is always a KeyboardEvent and the keyCodes are correct. But I still don't get vim openend.

jlebon commented 4 years ago

Right yeah, I think the root cause for this is similar to what I'm hitting in https://github.com/jlebon/textern/pull/43. I.e. newly dynamically created textareas throw off shortcut.js.

MaxGyver83 commented 4 years ago

OK, thanks for your answer!

jlebon commented 4 years ago

This is fixed in the v0.6 release!

MaxGyver83 commented 4 years ago

Awesome! Thank you.