[
https://issues.apache.org/jira/browse/FLEX-15441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Mclean updated FLEX-15441:
---------------------------------
Labels: easytest (was: )
> setSelection doesn't set insertion point correctly on a non-focused
> TextInput (and probably other text components)
> -------------------------------------------------------------------------------------------------------------------
>
> Key: FLEX-15441
> URL: https://issues.apache.org/jira/browse/FLEX-15441
> Project: Apache Flex
> Issue Type: Bug
> Components: mx: TextInput
> Affects Versions: Adobe Flex SDK 3.1 (Release)
> Environment: Affected OS(s): Mac
> Browser: Safari
> Language Found: English
> Reporter: Adobe JIRA
> Labels: easytest
>
> Steps to reproduce:
> 1. Use this MXML code:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
> <mx:NumericStepper minimum="0" id="step1"/>
> <mx:NumericStepper id="step2" minimum="0"/>
> <mx:Button label="Set Selection">
> <mx:click>tInput.setSelection(step1.value,
> step2.value)</mx:click>
> </mx:Button>
> <mx:TextInput id="tInput" text="0123456789"
> enter="tInput.setSelection(step1.value, step2.value)"/>
> <mx:Text text="Flex bug: pressing enter in the TextInput and hitting
> the "Set Selection"
> button both set the TextInput's selection using the values in the
> NumericSteppers. When the values
> are equal, hitting enter moves the cursor to the desired location, but
> the button doesn't; the
> problem seems to have to do with whether the focus is on the TextInput
> at the time setSelection
> is called. After hitting the button, you will need to tab to the
> TextInput to see the effect on
> the selection." width="300"/>
> </mx:Application>
> 2. Test it out by using the steppers and either the button or the enter key
> (when focused in TextInput) to invoke setSelection
> 3. Note that when the two steppers have the same value, the insertion point
> should be moved. It works fine when the focus
> is in the TextArea and you press enter, but when you use the button (and
> hence the focus is elsewhere), it sets the selection
> to the entire text.
> 4. Note also: I first discovered this bug with a subclassed TextInput where
> I'd set alwaysShowSelection to true on the TextField;
> it behaved in a *different* wrong fashion: it always moved the cursor to the
> start of the text. But watching the behavior in that
> case was where I became convinced that this is a focus issue.
>
> Actual Results: setSelection(index,index) selects the entire field when the
> focus is away from the field
>
> Expected Results: setSelection(index,index) should work the same whether the
> focus is on the field or not, and it should move the
> insertion point to "index"
>
> Workaround (if any): none that I know of.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira