mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 08:20:58 +00:00 
			
		
		
		
	Enhancement: open the searchbox on paste (#2320)
* Open the searchbox when detecting Ctrl-V. * support macOS, codestyle --------- Co-authored-by: Joschka <kontakt@greiner-it.de> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									d5608c46c3
								
							
						
					
					
						commit
						17b9b7e523
					
				@ -223,7 +223,10 @@ function Home({ initialSettings }) {
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    function handleKeyDown(e) {
 | 
			
		||||
      if (e.target.tagName === "BODY" || e.target.id === "inner_wrapper") {
 | 
			
		||||
        if (e.key.length === 1 && e.key.match(/(\w|\s)/g) && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
 | 
			
		||||
        if (
 | 
			
		||||
          (e.key.length === 1 && e.key.match(/(\w|\s)/g) && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) ||
 | 
			
		||||
          (e.key === "v" && (e.ctrlKey || e.metaKey))
 | 
			
		||||
        ) {
 | 
			
		||||
          setSearching(true);
 | 
			
		||||
        } else if (e.key === "Escape") {
 | 
			
		||||
          setSearchString("");
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user