Skip to content

Commit

Permalink
Ensure focus is not changed to ssh tunnel input box when user explici…
Browse files Browse the repository at this point in the history
…tly focus in server password edit box
  • Loading branch information
nikhil-mohite committed Nov 24, 2023
1 parent 338bb64 commit cdc2531
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function ConnectServerContent({closeModal, data, onOK, setHeight}
const classes = useModalStyles();
const containerRef = useRef();
const firstEleRef = useRef();
const [firstElState, setFirstElState] = useState();
const okBtnRef = useRef();
const [formData, setFormData] = useState({
tunnel_password: '',
Expand All @@ -46,7 +47,9 @@ export default function ConnectServerContent({closeModal, data, onOK, setHeight}

useEffect(()=>{
setTimeout(()=>{
firstEleRef.current && firstEleRef.current.focus();
if(!firstElState){
firstEleRef.current && firstEleRef.current.focus(), setFirstElState(firstEleRef.current);
}
}, 350);
}, [firstEleRef.current]);

Expand Down

0 comments on commit cdc2531

Please sign in to comment.