mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 17:28:29 +02:00
Fix input focus border
This commit is contained in:
@@ -54,7 +54,7 @@ export const ResponsePane = memo(function ResponsePane({ style, className }: Pro
|
|||||||
|
|
||||||
const tabs = useMemo(
|
const tabs = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{ label: 'Body', value: 'body' },
|
{ label: 'Preview', value: 'body' },
|
||||||
{
|
{
|
||||||
label: (
|
label: (
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ const _SidebarItem = forwardRef(function SidebarItem(
|
|||||||
justify="start"
|
justify="start"
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
className={classnames(
|
className={classnames(
|
||||||
editing && 'focus-within:border-focus',
|
editing && 'ring-1 focus-within:ring-focus',
|
||||||
active
|
active
|
||||||
? 'bg-highlight text-gray-900'
|
? 'bg-highlight text-gray-900'
|
||||||
: 'text-gray-600 group-hover/item:text-gray-800 active:bg-highlightSecondary',
|
: 'text-gray-600 group-hover/item:text-gray-800 active:bg-highlightSecondary',
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ export const Input = forwardRef<EditorView | undefined, InputProps>(function Inp
|
|||||||
const [currentValue, setCurrentValue] = useState(defaultValue ?? '');
|
const [currentValue, setCurrentValue] = useState(defaultValue ?? '');
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
|
|
||||||
const handleOnFocus = useCallback(() => {
|
const handleFocus = useCallback(() => {
|
||||||
setFocused(true);
|
setFocused(true);
|
||||||
onFocus?.();
|
onFocus?.();
|
||||||
}, [onFocus]);
|
}, [onFocus]);
|
||||||
|
|
||||||
const handleOnBlur = useCallback(() => {
|
const handleBlur = useCallback(() => {
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
onBlur?.();
|
onBlur?.();
|
||||||
}, [onBlur]);
|
}, [onBlur]);
|
||||||
@@ -107,8 +107,8 @@ export const Input = forwardRef<EditorView | undefined, InputProps>(function Inp
|
|||||||
className={classnames(
|
className={classnames(
|
||||||
containerClassName,
|
containerClassName,
|
||||||
'relative w-full rounded-md text-gray-900',
|
'relative w-full rounded-md text-gray-900',
|
||||||
'border border-highlight',
|
'border',
|
||||||
focused && 'border-focus',
|
focused ? 'border-focus' : 'border-highlight',
|
||||||
!isValid && '!border-invalid',
|
!isValid && '!border-invalid',
|
||||||
size === 'md' && 'h-md leading-md',
|
size === 'md' && 'h-md leading-md',
|
||||||
size === 'sm' && 'h-sm leading-sm',
|
size === 'sm' && 'h-sm leading-sm',
|
||||||
@@ -125,8 +125,8 @@ export const Input = forwardRef<EditorView | undefined, InputProps>(function Inp
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
className={inputClassName}
|
className={inputClassName}
|
||||||
onFocus={handleOnFocus}
|
onFocus={handleFocus}
|
||||||
onBlur={handleOnBlur}
|
onBlur={handleBlur}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
{type === 'password' && (
|
{type === 'password' && (
|
||||||
|
|||||||
Reference in New Issue
Block a user