Search Box: Handle focus properly
This commit is contained in:
		
					parent
					
						
							
								2db14e8d6f
							
						
					
				
			
			
				commit
				
					
						c0ebafe2bc
					
				
			
		
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -317,7 +317,7 @@ export function CompositionArea({
 | 
				
			||||||
    if (inputApiRef.current) {
 | 
					    if (inputApiRef.current) {
 | 
				
			||||||
      inputApiRef.current.focus();
 | 
					      inputApiRef.current.focus();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  }, []);
 | 
				
			||||||
  // Focus input whenever explicitly requested
 | 
					  // Focus input whenever explicitly requested
 | 
				
			||||||
  useEffect(() => {
 | 
					  useEffect(() => {
 | 
				
			||||||
    if (focusCounter !== previousFocusCounter && inputApiRef.current) {
 | 
					    if (focusCounter !== previousFocusCounter && inputApiRef.current) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -339,7 +339,10 @@ export function reducer(
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (action.type === 'SEARCH_CLEAR') {
 | 
					  if (action.type === 'SEARCH_CLEAR') {
 | 
				
			||||||
    return getEmptyState();
 | 
					    return {
 | 
				
			||||||
 | 
					      ...getEmptyState(),
 | 
				
			||||||
 | 
					      startSearchCounter: state.startSearchCounter,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (action.type === 'SEARCH_UPDATE') {
 | 
					  if (action.type === 'SEARCH_UPDATE') {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue