Project

General

Profile

keyWentDown and keyPressed events do not propagate from WTextEdit

Added by Laszlo Marak over 8 years ago

Hello, I am not sure if this is bugreport or a forum question.

I am making a web app, and I strongly want some features to be accessible through hot keys (keyboard shortcuts). I have a complex layout with mediaplayer and a texteditor in it (among many other widgets). I want to be able to start/stop the playback WITHOUT clicking. This is not a question about how to catch a propagating event from any container. The problem is the following: If I use WTextArea than the keyPressed and keyWentDown events both arrive in the event handler. If I, however use WTextEdit, no events arrive. WTextArea also has WInteractWidget as it's base, but apparently the events do not propagate from TinyMCE to the WInteractWidget. My question is:

1) is it a technical limitation of TinyMCE

2) is it a feature waiting to be implemented

3) is it a bug waiting to be reported

thank You for reading this.


Replies (14)

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Laszlo Marak over 8 years ago

update:

It is possible that the keyPressedDown event does not propagate with TinyMCE 3. I have tried to update TinyMCE as I have managed to create a minimal example which propagates the keyPressedDown event (attached).

I think it is related, but I cannot start TinyMCE version 4.2.4 with witty. I change the properties in the xml, but witty is looking for a file named

tinymce.js

whereas we have a file named

tinymce.min.js

test.html (586 Bytes) test.html

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Wim Dumon over 8 years ago

Laszlo,

From the top of my head, tinymce uses an iframe to render its contents, and events indeed don't propagate properly. I don't know if there is a way around this. To resolve the file name issue, you can probably simply rename tinymce.min.js to tinymce.js.

Wim.

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk over 3 years ago

I wanted to tap this thread and see if there is any way to get events from tinymce back in to Wt? If anyone has looked in to it yet or if it is at all possible?

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Christian Meyer almost 3 years ago

I currently get Input from TextEdit through the Signal "textInput()" which fires on each keystroke, or text modification (like pasting)

I am trying to figure out why there is no content displayed after rerendering (hiding containing widget and showing it later)

setText works once, but not in a rerendered version ...

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk almost 3 years ago

Hi Christian,

Are you able to post up a little test case that I could run to see what you're seeing?

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Christian Meyer almost 3 years ago

No, I am not =D

I changed something in My Code and now I can not reproduce the behaviour =D

Setup was a Widget with a split implementation of a visible Display of Data and a hidden TextEdit inside a extra WTemplate to Manipulate

On selection of a different Dataset, The Widget is reused, and the content adapted.

In the previous State, on a Datasetchange, the extra WTemplate with the TextEdit would always be hidden with setHidden

Then I was messing around with having the edit visible when the Datasetchange occured or having it invisible.
And even then was it not predictable as to when the content was visible and when not.

Now the Datasetchange does not hide the WTemplate, but keeps the visibility state of what it was before.

What definitely hides the content is when a containing template is rerendered.
I.e. When bindString is used, the content will still somehow be in TextEdit, just not visible.

I will see if I can recreate a TestCase on this and Post it then

Cheers

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk almost 3 years ago

OK, well, it sounds odd.

You would be able to update a widget at any time, in any place (in code) and it shouldn't matter if the widget is visible or not. Usually they just stay up to date.

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Christian Meyer almost 3 years ago

I did Manage to Create a TestCase, but it seems to be showing another extreme...

You could bind the Testcase into any Project and just Create a new Widget of TestCase::SetupWidget

In this TestCase WTextEdit::setText fails completely. Not event after initial Loading is any Text Visible.

There are Three TestCases to choose from:

  1. Hiding after Setting Values,
  2. Leave hiddenStatus alone while setting Values,
  3. is like 2 but set Values after each visibility Toggle.

In my Project I "managed" to reproduce the setText Issue... which I am not very happy about.

It seemed, that if the Text was set before while WTextEdit was Visible, it would work.
The WTemplate could then be setHidden and made Visible again and the Text would show.

FYI: I am using TinyMCE in Version 5.8.0 and SubClassed WTextEdit in my Project to setup a Toolbar and Plugins, for some areas in the Project.
Wt: 4.5.0 from Git pulled May 15
Browser: Firefox 89.0, Chrome 91.0.4472.101

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk almost 3 years ago

Hi Christian,

I built and tested your object.

At first glance, it appears to operate as I would expect. So, if there is a "sequence of clicks" I can use to see exactly the symptom you are seeing, that would be helpful.

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Christian Meyer almost 3 years ago

I am not sure we see the same thing then =)

I attached a Screenshot in the "Edit State" of what I see.

Could you give me info about your TinyMCE Version?

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk almost 3 years ago

Yes, I have attached my image.

Question is, how did you get there

  1. open widget
  2. click "Title Nr: 4"
  3. click "TestVersion-Selector" set to "2"
  4. click "edit button"

Attached is that screen shot.

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Mark Petryk almost 3 years ago

This is from my MCE;

majorVersion : '3'
minorVersion : '5.11'
releaseDate : '2014-05-08'

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Christian Meyer almost 3 years ago

Managed to test TinyMCE v3.5.11 and the setText works as expected and as you see.

Version 5.8.0 however does not, even though the content seems to flicker through at the first change

Please try with a current version

You can get a version for self-hosting here:
https://www.tiny.cloud/get-tiny/self-hosted/

Steps to reproduce:

  1. Set Test Version
  2. Click Edit to see if Initial Values are being displayed
  3. Select different Item to see Value Change

TestVersion 1 will hide editing fields on item change and "Edit" needs to be clicked to check values
TestVersion 2 and 3 will keep editing fields either hidden or Visible, just as they were before itemchange
TestVersion 3 will call setText again after setting visible.

Currently with V5 the TextEdit is never filled, just the first time there is a flash of content

Thank you for looking into this!

Cheers

RE: keyWentDown and keyPressed events do not propagate from WTextEdit - Added by Roel Standaert almost 3 years ago

Yeah, I think the TinyMCE 5 support isn't quite there yet.

    (1-14/14)