diff --git a/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx b/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx index fd93a59551..2ae79b682f 100644 --- a/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx +++ b/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx @@ -7,6 +7,7 @@ */ import { observer } from 'mobx-react'; +import { useCallback } from 'react'; import styled from 'reshadow'; import { InputField } from '@cloudbeaver/core-blocks'; @@ -37,6 +38,18 @@ export const ObjectPropertyInfoForm = observer(function ObjectPropertyInfoForm({ return styled(useStyles(formStyles))(
Properties empty
); } + const handleFocus = useCallback((e: React.FocusEvent) => { + if (e.target.type !== 'password') { + return; + } + + const property = properties.find(property => property.id === e.target.name); + + if (property?.value === e.target.value) { + credentials[e.target.name] = ''; + } + }, [properties, credentials]); + return styled(useStyles(formStyles))( {properties.map(property => ( @@ -45,6 +58,7 @@ export const ObjectPropertyInfoForm = observer(function ObjectPropertyInfoForm({ type={property.features.includes('password') ? 'password' : 'text'} name={property.id!} state={credentials} + onFocus={handleFocus} disabled={disabled} autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`} mod='surface' diff --git a/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionForm.tsx b/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionForm.tsx index 214bb1ec5c..16f2ae03b7 100644 --- a/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionForm.tsx +++ b/webapp/packages/core-connections/src/Administration/Connections/ConnectionForm/ConnectionForm.tsx @@ -157,6 +157,14 @@ export const ConnectionForm = observer(function ConnectionForm({ > {translate('ui_processing_cancel')} +