Open adamb111 opened 13 years ago
Thanks for your report. adamb111 already pinpointed the problem: The render peer of the TextComponent drops & replaces the HTML DOM element on updates it cannot apply incrementally.
Support for key shortcuts should be part of the core Echo framework. The KeystrokeListener component can only act as workaround. It behaves like a component without any real visible (DOM) element, which modifies / attaches DOM event listener on DOM elements belonging to other (the targeted) components.
The initially attached key event listener on the textbox DOM element gets lost, because Echo replaces its with a new copy and the Keylistener-Component has no clue that it needs to reattach a new event listener to the new component.
Adamb111's change just avoids this an implements an incremental update for background colour changes. So it fixes this special problem but similar will happen on other changes which lead to a "fullRender".
I tested KeystrokeListener and found small but annoying bug. To reproduce bug, add to class KeystrokeTest call tf1.setBackground() as follows and run server-side demo app.
...... final TextField tf1 = new TextField(); instructLabel.setFormatWhitespace(true);
...... Now click CheckBox. H-key listener doesn't work, but ctrl-h listener still works. I found workaround. Unfortunately it isn't simple, doesn't solve all potential problems and needs to change Echo sources. The file SyncTextComponent.js from Echo3 contains class Echo.Sync.TextComponent, and function renderUpdate. I changed this function and add getSupportedPartialProperties():