flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Palombaro (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-24442) s:textarea doesn't support keyboard ctrl-z (undo) command in IE7
Date Wed, 08 Oct 2014 02:18:33 GMT

    [ https://issues.apache.org/jira/browse/FLEX-24442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162951#comment-14162951

Alessandro Palombaro commented on FLEX-24442:

Another workaround is to listen for the keyup event instead (which triggers in IE correctly)
and then manually dispatch a keydown event on the TextAreas textDisplay skinPart (RichEditableText)
textContainerManager (mx_internal property) container which is what the undo manager is listening
for the events on.

Example. First check if the user is running IE (I used ExternalInterface call and navigater.userAgent
search, but there might be an easier way), otherwise a single undo operation will trigger

If the user is running IE add the keyup listener to the textArea instance and then manually
dispatch a keydown event on the target of the undo manager

protected function _keyUpHandler(event:KeyboardEvent):void
  if (event.ctrlKey && event.keyCode == Keyboard.Z)
              var richText:RichEditableText = textArea.textDisplay as RichEditableText;
				var event:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, event.bubbles, event.cancelable,
						event.charCode, event.keyCode, event.keyLocation, event.ctrlKey, event.altKey, event.shiftKey);
// unfortunately only means of accessing the target container seems to be via mx_internal

Anyway hope this helps

> s:textarea doesn't support keyboard ctrl-z (undo) command in IE7
> ----------------------------------------------------------------
>                 Key: FLEX-24442
>                 URL: https://issues.apache.org/jira/browse/FLEX-24442
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: TextArea
>    Affects Versions: Adobe Flex SDK 4.1 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Browser: Internet Explorer 7.x
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easytest
>         Attachments: SparkTextAreaUnDoReDoInputBug_src.zip
> Steps to reproduce:
> 1. Just embed a s:textarea and try to use the undo command (ctrl-z) after typing
> I tried the undo command on several tutorial websites using the textarea component in
IE7 and it doesn't work either. Only using Firefox does it work. 
> Note: I can make the textarea perform the undo operation in code by using the undoManager.
>  Actual Results:
>  nothing occurs
>  Expected Results:
>  the text should undo
>  Workaround (if any):
>  it works in mozilla firefox

This message was sent by Atlassian JIRA

View raw message