@@ -364,7 +364,8 @@ MOD.Hook("INITIALIZE", () => {
364364 SEE ALSO: AutoComplete.onSuggestionSelected() and
365365 D3SimpleNetGraph._UpdateGraph click handler
366366 /*/
367- UDATA . HandleMessage ( "SOURCE_SELECT" , function ( data ) {
367+ UDATA . HandleMessage ( "SOURCE_SELECT" , m_sourceSelect ) ;
368+ function m_sourceSelect ( data ) {
368369 if ( DBG ) console . log ( PR , "SOURCE_SELECT got data" , data ) ;
369370
370371 let { nodeLabels = [ ] , nodeIDs = [ ] } = data ;
@@ -413,7 +414,7 @@ MOD.Hook("INITIALIZE", () => {
413414
414415 // Set the SELECTION state so that listeners such as NodeSelectors update themselves
415416 UDATA . SetAppState ( "SELECTION" , newState ) ;
416- } ) ;
417+ }
417418
418419 /// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inside hook
419420 /*/ SOURCE_SEARCH sets the current matching term as entered in an
@@ -432,6 +433,20 @@ MOD.Hook("INITIALIZE", () => {
432433 UDATA . SetAppState ( "SEARCH" , newState ) ;
433434 } ) ;
434435
436+ /// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inside hook
437+ /*/ SOURCE_SEARCH_AND_SELECT first searches for an exact mathcing node
438+ and if found, selects it.
439+ This is called by AutoComplete onBlur in case we need to make an
440+ implicit selection.
441+ /*/
442+ UDATA . HandleMessage ( "SOURCE_SEARCH_AND_SELECT" , function ( data ) {
443+ let { searchString } = data ;
444+ let node = m_FindMatchingNodesByLabel ( searchString ) . shift ( ) ;
445+ if ( node && ( node . label === searchString ) ) {
446+ m_sourceSelect ( { nodeIDs : [ node . id ] } ) ;
447+ }
448+ } ) ;
449+
435450 /// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inside hook
436451 /*/ SOURCE_HILITE updates the currently rolled-over node name in a list of
437452 selections. The hilite can be selected via either the label or
0 commit comments