fix(aio): SearchBoxComponent should send query on click
				
					
				
			The input may still have focus when the user hits ESC, causing the search to be hidden. If the user then clicks on the input again, they would expect it to reopen the results.
This commit is contained in:
		
							parent
							
								
									0e6eb6d719
								
							
						
					
					
						commit
						c95a3048ce
					
				| @ -3,5 +3,6 @@ | |||||||
|          mdInput |          mdInput | ||||||
|          placeholder="Search" |          placeholder="Search" | ||||||
|          (keyup)="onSearch($event.target.value, $event.which)" |          (keyup)="onSearch($event.target.value, $event.which)" | ||||||
|          (focus)="onSearch($event.target.value)"> |          (focus)="onSearch($event.target.value)" | ||||||
|  |          (click)="onSearch($event.target.value)"> | ||||||
| </md-input-container> | </md-input-container> | ||||||
|  | |||||||
| @ -67,4 +67,12 @@ describe('SearchBoxComponent', () => { | |||||||
|       expect(search.search).toHaveBeenCalledWith('some query'); |       expect(search.search).toHaveBeenCalledWith('some query'); | ||||||
|     })); |     })); | ||||||
|   }); |   }); | ||||||
|  | 
 | ||||||
|  |   describe('on click', () => { | ||||||
|  |     it('should call the search service on click', inject([SearchService], (search: SearchService) => { | ||||||
|  |       const input = fixture.debugElement.query(By.css('input')); | ||||||
|  |       input.triggerEventHandler('click', { target: { value: 'some query'}}); | ||||||
|  |       expect(search.search).toHaveBeenCalledWith('some query'); | ||||||
|  |     })); | ||||||
|  |   }); | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user