fix paste

This commit is contained in:
Mathew Pareles 2025-03-23 23:24:08 -07:00
parent 1f98e75a4f
commit 69a75f5c47
2 changed files with 6 additions and 7 deletions

View file

@ -153,19 +153,17 @@ export const VoidInputBox2 = forwardRef<HTMLTextAreaElement, InputBox2Props>(fun
})
export const VoidSimpleInputBox = ({ value, onChangeValue, placeholder, className, disabled, ...inputProps }: {
export const VoidSimpleInputBox = ({ value, onChangeValue, placeholder, className, disabled, passwordBlur, ...inputProps }: {
value: string;
onChangeValue: (value: string) => void;
placeholder: string;
className?: string;
disabled?: boolean;
passwordBlur?: boolean;
} & React.InputHTMLAttributes<HTMLInputElement>) => {
const inputRef = useRef<HTMLInputElement>(null);
return (
<input
ref={inputRef}
type="text"
value={value}
onChange={(e) => onChangeValue(e.target.value)}
placeholder={placeholder}
@ -174,10 +172,12 @@ export const VoidSimpleInputBox = ({ value, onChangeValue, placeholder, classNam
${disabled ? 'opacity-50 cursor-not-allowed' : ''}
${className}`}
style={{
...passwordBlur && { WebkitTextSecurity: 'disc' },
background: asCssVariable(inputBackground),
color: asCssVariable(inputForeground)
}}
{...inputProps}
type={undefined} // VS Code is doing some annoyingness that breaks paste if this is defined
/>
);
};

View file

@ -262,6 +262,7 @@ const ProviderSetting = ({ providerName, settingName }: { providerName: Provider
const settingsState = useSettingsState()
const settingValue = settingsState.settingsOfProvider[providerName][settingName] as string // this should always be a string in this component
console.log(`providerName:${providerName} settingName: ${settingName}, settingValue: ${settingValue}`)
if (typeof settingValue !== 'string') {
console.log('Error: Provider setting had a non-string value.')
return
@ -274,11 +275,9 @@ const ProviderSetting = ({ providerName, settingName }: { providerName: Provider
onChangeValue={useCallback((newVal) => {
voidSettingsService.setSettingOfProvider(providerName, settingName, newVal)
}, [voidSettingsService, providerName, settingName])}
// placeholder={`${providerTitle} ${settingTitle} (${placeholder})`}
placeholder={`${settingTitle} (${placeholder})`}
type={isPasswordField ? 'password' : 'text'}
passwordBlur={isPasswordField}
/>
{subTextMd === undefined ? null : <div className='py-1 px-3 opacity-50 text-sm'>
<ChatMarkdownRender string={subTextMd} chatMessageLocation={undefined} />