feat: complete phase 2 UX improvements
This commit is contained in:
@@ -19,6 +19,7 @@ export default function RichTextField({
|
||||
placeholder,
|
||||
minRows = 2,
|
||||
ariaLabel,
|
||||
disabled = false,
|
||||
}: {
|
||||
value: string;
|
||||
onChange: (v: string) => void;
|
||||
@@ -26,6 +27,7 @@ export default function RichTextField({
|
||||
placeholder?: string;
|
||||
minRows?: number;
|
||||
ariaLabel?: string;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const ref = useRef<HTMLTextAreaElement | null>(null);
|
||||
|
||||
@@ -42,7 +44,7 @@ export default function RichTextField({
|
||||
|
||||
const btn = (title: string, icon: React.ReactNode, before: string, after: string, ph: string) => (
|
||||
<Tooltip title={title}>
|
||||
<IconButton size="small" aria-label={title} onMouseDown={(e) => e.preventDefault()} onClick={() => apply(before, after, ph)}>
|
||||
<IconButton size="small" disabled={disabled} aria-label={title} onMouseDown={(e) => e.preventDefault()} onClick={() => apply(before, after, ph)}>
|
||||
{icon}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
@@ -65,6 +67,7 @@ export default function RichTextField({
|
||||
fullWidth
|
||||
size="small"
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
slotProps={{ htmlInput: { "aria-label": ariaLabel ?? label } }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user