@@ -78,6 +78,14 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
7878 _createChildControlImpl : function ( id ) {
7979 let control ;
8080 switch ( id ) {
81+ case "search-bar-filter" :
82+ control = new osparc . dashboard . SearchBarFilter ( this . __resourceType ) ;
83+ control . getChildControl ( "text-field" ) . addListener ( "appear" , ( ) => {
84+ control . getChildControl ( "text-field" ) . focus ( ) ;
85+ control . getChildControl ( "text-field" ) . activate ( ) ;
86+ } ) ;
87+ this . _add ( control ) ;
88+ break ;
8189 case "context-buttons" :
8290 control = new qx . ui . toolbar . ToolBar ( ) . set ( {
8391 spacing : 0 ,
@@ -111,10 +119,6 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
111119 ) ;
112120 this . getChildControl ( "context-buttons" ) . add ( control ) ;
113121 break ;
114- case "search-bar-filter" :
115- control = new osparc . dashboard . SearchBarFilter ( this . __resourceType ) ;
116- this . _add ( control ) ;
117- break ;
118122 case "filter-buttons" :
119123 control = new qx . ui . toolbar . ToolBar ( ) . set ( {
120124 backgroundColor : osparc . dashboard . SearchBarFilter . BG_COLOR ,
@@ -139,6 +143,19 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
139143 this . getChildControl ( "search-bar-filter" ) . set ( {
140144 showFilterMenu : false ,
141145 } ) ;
146+
147+ const textField = this . getChildControl ( ( "search-bar-filter" ) ) . getChildControl ( "text-field" ) ;
148+ textField . addListener ( "keypress" , e => {
149+ if ( e . getKeyIdentifier ( ) === "Enter" ) {
150+ this . __sourceSearchBarFilter . getChildControl ( "text-field" ) . setValue ( textField . getValue ( ) ) ;
151+ this . exclude ( ) ;
152+ }
153+ } , this ) ;
154+ textField . addListener ( "changeValue" , ( ) => {
155+ this . __sourceSearchBarFilter . getChildControl ( "text-field" ) . setValue ( textField . getValue ( ) ) ;
156+ this . exclude ( ) ;
157+ } , this ) ;
158+
142159 const resetButton = this . getChildControl ( "search-bar-filter" ) . getChildControl ( "reset-button" ) ;
143160 resetButton . set ( {
144161 paddingRight : 2 , // 10-8
@@ -190,7 +207,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
190207 const button = new qx . ui . menu . RadioButton ( option . label ) ;
191208 menu . add ( button ) ;
192209 button . addListener ( "execute" , ( ) => {
193- this . getChildControl ( "search-bar-filter" ) . setSharedWithActiveFilter ( option . id , option . label ) ;
210+ this . __sourceSearchBarFilter . setSharedWithActiveFilter ( option . id , option . label ) ;
194211 this . exclude ( ) ;
195212 } ) ;
196213 sharedWithRadioGroup . add ( button ) ;
@@ -213,7 +230,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilterExtended", {
213230 tagButton . getChildControl ( "icon" ) . setTextColor ( tag . getColor ( ) ) ;
214231 menu . add ( tagButton ) ;
215232 tagButton . addListener ( "execute" , ( ) => {
216- this . getChildControl ( "search-bar-filter" ) . addTagActiveFilter ( tag ) ;
233+ this . __sourceSearchBarFilter . addTagActiveFilter ( tag ) ;
217234 this . exclude ( ) ;
218235 } ) ;
219236 } ) ;
0 commit comments