Fixed highlighting text on drag

This commit is contained in:
Emir Karabeg
2025-01-13 12:24:32 -08:00
parent e5506188d0
commit e3a7a3093c
4 changed files with 10 additions and 8 deletions

View File

@@ -192,7 +192,7 @@ export default function Workflow() {
return (
<div
className="w-full h-[calc(100vh-56px)] overflow-hidden"
className="w-full h-[calc(100vh-56px)] overflow-hidden select-none"
onWheel={handleWheel}
>
<div

View File

@@ -2,7 +2,7 @@ import { Input } from '@/components/ui/input'
import { useState } from 'react'
interface ShortInputProps {
placeholder: string
placeholder?: string
password?: boolean
}
@@ -13,7 +13,7 @@ export function ShortInput({ placeholder, password }: ShortInputProps) {
return (
<Input
className="w-full"
placeholder={placeholder}
placeholder={placeholder ?? ''}
type={password && !isFocused ? 'password' : 'text'}
value={value}
onChange={(e) => setValue(e.target.value)}

View File

@@ -19,10 +19,12 @@ export function SubBlock({ config }: SubBlockProps) {
const renderInput = () => {
switch (config.type) {
case 'short-input':
return <ShortInput
placeholder={config.placeholder ?? ''}
password={config.password}
/>
return (
<ShortInput
placeholder={config.placeholder}
password={config.password}
/>
)
case 'long-input':
return <LongInput />
case 'dropdown':

View File

@@ -109,7 +109,7 @@ export function WorkflowBlock({
return (
<Card
className={cn(
'absolute w-[320px] shadow-md cursor-move',
'absolute w-[320px] shadow-md cursor-move select-none',
'transform -translate-x-1/2 -translate-y-1/2',
isDragging && 'pointer-events-none'
)}