You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/04/29 09:14:29 UTC

[royale-asjs] branch develop updated: searchfilter: fix an issue in combobox when using a searchfilter and filter and down to the item, left the control unresponsive

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new f949f93  searchfilter: fix an issue in combobox when using a searchfilter and filter and down to the item, left the control unresponsive
f949f93 is described below

commit f949f9343af5e42df712825ac377a129d061fe7c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Apr 29 11:14:25 2020 +0200

    searchfilter: fix an issue in combobox when using a searchfilter and filter and down to the item, left the control unresponsive
---
 .../jewel/beads/controls/combobox/SearchFilter.as      | 18 ++++++++++++++----
 .../beads/controls/textinput/SearchFilterForList.as    |  5 +++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/SearchFilter.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/SearchFilter.as
index ba1a2c0..f8ebdb5 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/SearchFilter.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/SearchFilter.as
@@ -64,11 +64,20 @@ package org.apache.royale.jewel.beads.controls.combobox
                 comboView.popUpVisible = true;
 			
 			// fill "list" with the internal list in the combobox popup
-			list = comboView.popup.view.list;
+			//list = comboView.popup.view.list;
 			
 			applyFilter(comboView.textinput.text.toUpperCase());
 
-			ComboBoxView(_strand['view']).autoResizeHandler(); //as we filter the popup list will be smaller, and we want to reposition
+			ComboBoxView(comboView).autoResizeHandler(); //as we filter the popup list will be smaller, and we want to reposition
+		}
+
+		override protected function selectItem(item:Object):void
+		{
+			// Select the item in the list if text is the same 
+			// we do at the end to avoid multiple selection (if there's more than one matches)
+			// in that case, select the first one in the list
+			// if(item != null)
+			// 	list.selectedItem = item;
 		}
 
 		override protected function onBeadsAdded(event:Event):void{
@@ -79,8 +88,9 @@ package org.apache.royale.jewel.beads.controls.combobox
 			{
                 var _textInput:TextInputBase = comboView.textinput as TextInputBase;
                 if (_textInput) {
-					COMPILE::JS {
-                        _textInput.element.addEventListener('focus', onInputFocus);
+					COMPILE::JS
+					{
+                    _textInput.element.addEventListener('focus', onInputFocus);
                     }
             	}
             }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/SearchFilterForList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/SearchFilterForList.as
index bbea325..da51dfe 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/SearchFilterForList.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/textinput/SearchFilterForList.as
@@ -318,6 +318,11 @@ package org.apache.royale.jewel.beads.controls.textinput
 
 			_visibleIndexes = _visibleIndexes.sort(numberSort);
 
+			selectItem(item);
+		}
+
+		protected function selectItem(item:Object):void
+		{
 			// Select the item in the list if text is the same 
 			// we do at the end to avoid multiple selection (if there's more than one matches)
 			// in that case, select the first one in the list