It seems with resizable multiline inputText, when we use either enter or
backspace to add/remove newlines,
no new character is sensed - specifically, no 'ontext' event is generated.

The following sample is a working example that illustrates the issue.

Click on the gray box and the following character sequence shows the issue
with
newlines not being sent to the ontext event.

aaaa<enter>
a<backspace><backspace>a

My expectation -
1. The <enter> adds a newline to the text and generate an 'ontext' event -
and the inputtext view to be resized.
2. The second backspace deletes the newline added & generate another
'ontext' event and therefore a resize.

However, in both cases, it's the first text modification around the newline
that results in a change and triggering
the expected behaviour. That is the 'a' after <enter> and the 'a' after the
second <backspace> cause the
desired resize.

I didn't find anything obvious on jira. Am I missing something?
Would appreciate any help I can get understanding what the issue is and if I
can solve this.

I am using 4.0.7 on windows (vista) + firefox + swf7.
-shishir


<canvas>
  <inputtext multiline='true' resizable='true'
    x='20' y='20' width='10' height='16' bgcolor='#DDDDDD'>

    <method name="setSize" >
      setWidth((getTextWidth() > 0)?(getTextWidth()+5):100);
      setHeight((getTextHeight() > 0)?(getTextHeight()+5):16);
      Debug.write('new height - ' + getTextHeight() + ' ' + getHeight());
    </method>

    <handler name="ontext">
      setSize('false');
    </handler>

    <method name="resize_add" args="d">
      Debug.write('text after enter' + getText());
      setSize('true');
    </method>

    <method name="resize_del" args="d">
      Debug.write('text after backspace' + getText());
      setSize('false');
    </method>

    <handler name="oninit">
      var resize_add = new LzDelegate(this, "resize_add");
      var resize_del = new LzDelegate(this, "resize_del");
      LzKeys.callOnKeyCombo(resize_add, ['enter']);
      LzKeys.callOnKeyCombo(resize_del, ['backspace']);
      // set focus to the newly created inputbox after creation
      onfocus.sendEvent();
    </handler>
  </inputtext>
</canvas>

Reply via email to