This repository was archived by the owner on Sep 18, 2021. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 181181
182182                input . confidence  =  DOMPurify . sanitize ( firstChoice . confidence ) ; 
183183                input . value  =  DOMPurify . sanitize ( firstChoice . text ) ; 
184-                 input . size  =  input . value . length ; 
184+                 input . size  =  Math . max ( input . value . length ,   10 ) ; 
185185                input . idx_suggestion  =  0 ; 
186186
187187                if  ( list )  { 
197197                        list . classList . add ( 'close' ) ; 
198198                        resolve ( input ) ; 
199199                    } 
200-                     else  if ( e . keyCode  ===  8 )  { 
201-                         input . size -- ; 
202-                         list . style . width  =  `${ input . offsetWidth }  ; 
200+                     else  if ( e . keyCode  ===  8  ||  e . keyCode  ===  46 )  { 
201+                         if  ( input . size  >  10 )  { 
202+                             input . size -- ; 
203+                             list . style . width  =  `${ input . offsetWidth }  ; 
204+                         } 
203205                    } 
204206                    else  if ( e . keyCode  <  37  ||  e . keyCode  >  40 )  { 
205-                         input . size  =  input . value . length ; 
207+                         input . size  =  Math . max ( 10 ,   input . value . length ) ; 
206208                        list . style . width  =  `${ input . offsetWidth }  ; 
207209                    } 
208210                } ) ; 
464466
465467    // Click handler for stm icon 
466468    const  on_stm_icon_click  =  event  =>  { 
469+         const  type  =  event . detail  ? "button"  : "keyboard" ; 
467470        event . preventDefault ( ) ; 
468-         metrics . start_session ( ) ; 
471+         metrics . start_session ( type ) ; 
469472        event . target . classList . add ( "stm-hidden" ) ; 
470473        event . target . disabled  =  true ; 
471474        SpeakToMePopup . showAt ( event . clientX ,  event . clientY ) ; 
Original file line number Diff line number Diff line change 207207    padding :  4px   8px  ;
208208    position :  relative;
209209    transition :  background 75ms  ,  box-shadow 75ms  ;
210-     max-width :  20 vw 
210+     max-width :  600 px 
211211}
212212
213213# stm-input : focus  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments