mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-31 12:47:58 +00:00 
			
		
		
		
	Fixes resetting of scroll position in RecordShowPage due to opening of some dropdowns (#6890) (#6906)
fixes #6890 --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
		 Faisal-imtiyaz123
					Faisal-imtiyaz123
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							601e15f028
						
					
				
				
					commit
					72ab6bcf35
				
			| @@ -1,5 +1,6 @@ | ||||
| import { forwardRef, InputHTMLAttributes } from 'react'; | ||||
| import { useInputFocusWithoutScrollOnMount } from '@/ui/input/hooks/useInputFocusWithoutScrollOnMount'; | ||||
| import styled from '@emotion/styled'; | ||||
| import { forwardRef, InputHTMLAttributes } from 'react'; | ||||
| import { TEXT_INPUT_STYLE } from 'twenty-ui'; | ||||
|  | ||||
| const StyledDropdownMenuSearchInputContainer = styled.div` | ||||
| @@ -35,12 +36,16 @@ const StyledInput = styled.input` | ||||
| export const DropdownMenuSearchInput = forwardRef< | ||||
|   HTMLInputElement, | ||||
|   InputHTMLAttributes<HTMLInputElement> | ||||
| >(({ value, onChange, autoFocus, placeholder = 'Search', type }, ref) => ( | ||||
|   <StyledDropdownMenuSearchInputContainer> | ||||
|     <StyledInput | ||||
|       autoComplete="off" | ||||
|       {...{ autoFocus, onChange, placeholder, type, value }} | ||||
|       ref={ref} | ||||
|     /> | ||||
|   </StyledDropdownMenuSearchInputContainer> | ||||
| )); | ||||
| >(({ value, onChange, placeholder = 'Search', type }) => { | ||||
|   const { inputRef } = useInputFocusWithoutScrollOnMount(); | ||||
|  | ||||
|   return ( | ||||
|     <StyledDropdownMenuSearchInputContainer> | ||||
|       <StyledInput | ||||
|         autoComplete="off" | ||||
|         {...{ onChange, placeholder, type, value }} | ||||
|         ref={inputRef} | ||||
|       /> | ||||
|     </StyledDropdownMenuSearchInputContainer> | ||||
|   ); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user