flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Mclean (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FLEX-35118) focusedTextSelectionColor suppresses the characters in the textinput when set to black
Date Mon, 07 Nov 2016 00:38:58 GMT

     [ https://issues.apache.org/jira/browse/FLEX-35118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Justin Mclean resolved FLEX-35118.
----------------------------------
    Resolution: Not A Bug

Not a bug if you change the selection background text you also need to change the text colour
and you also need to check the selection range to see what text has been selected.

Try something along the lines of:
{code}
			protected function test_selectionChangeHandler(event:FlexEvent):void
			{
				var textInput:spark.components.TextInput = event.target as  spark.components.TextInput;
				var length:int = textInput.text.length;
				
				if (textInput.selectionActivePosition == length &&  textInput.selectionAnchorPosition
== 0) { 
					test.setStyle("focusedTextSelectionColor", "#000000" );
					test.setStyle("color", "#FFFFFF");
				}
				else {
					test.setStyle("color", "#000000");
				}
			}	
{code}

> focusedTextSelectionColor suppresses the characters in the textinput when set to black
> --------------------------------------------------------------------------------------
>
>                 Key: FLEX-35118
>                 URL: https://issues.apache.org/jira/browse/FLEX-35118
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: TextInput
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Ankush Bangroo
>              Labels: easytest
>
> When text is selected in spark textinput component , background color of text is light
blue.The behavior in mx component is different, since the background color of text is black.
> I tried to use the setStyle method to change the background color of the text , but setting
the value to black overwhelms the characters that have been selected in the TextInput.
> Can you please provide a resolution so that behavior of mx and spark text input is same.
> Sample Code here:
> {noformat}
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:s="library://ns.adobe.com/flex/spark"
>                xmlns:mx="library://ns.adobe.com/flex/mx"
>                xmlns:fx="http://ns.adobe.com/mxml/2009"
>                minWidth="300"
>                minHeight="400">
> 	<fx:Script>
> 		<![CDATA[
> 			import mx.events.FlexEvent;
> 			protected function test_selectionChangeHandler(event:FlexEvent):void
> 			{
> 				// TODO Auto-generated method stub
> 				test.setStyle("focusedTextSelectionColor", "##000000" );
> 			}			
> 		]]>
> 	</fx:Script>
>     <s:VGroup>
> 		<s:Label text="①TextInput">
> 		</s:Label>
> 		<mx:HBox>
> 			<mx:VBox>
> 				<s:Label text="↓mx.controls.TextInput">
> 				</s:Label>
> 				<mx:TextInput width="200" text="サンプル">
> 				</mx:TextInput>
> 			</mx:VBox>
> 			<mx:VBox>
> 				<s:Label text="↓spark.components.TextInput">
> 				</s:Label>
> 				<s:TextInput id="test" width="200" text="サンプル" fontFamily="U-PRESS" selectionChange="test_selectionChangeHandler(event)">
> 				</s:TextInput>
> 			</mx:VBox>
> 		</mx:HBox>
>     </s:VGroup>
> </s:Application>
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message