mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 15:55:52 +01:00
chore(react/ribbon): working execute search button
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
interface FormTextAreaProps {
|
||||
import { TextareaHTMLAttributes } from "preact/compat";
|
||||
|
||||
interface FormTextAreaProps extends Omit<TextareaHTMLAttributes, "onBlur" | "onChange"> {
|
||||
id?: string;
|
||||
currentValue: string;
|
||||
onChange?(newValue: string): void;
|
||||
onBlur?(newValue: string): void;
|
||||
rows: number;
|
||||
className?: string;
|
||||
placeholder?: string;
|
||||
}
|
||||
export default function FormTextArea({ id, onBlur, rows, currentValue, className, placeholder }: FormTextAreaProps) {
|
||||
export default function FormTextArea({ id, onBlur, onChange, rows, currentValue, className, ...restProps }: FormTextAreaProps) {
|
||||
return (
|
||||
<textarea
|
||||
id={id}
|
||||
rows={rows}
|
||||
className={`form-control ${className ?? ""}`}
|
||||
onChange={(e) => {
|
||||
onChange?.(e.currentTarget.value);
|
||||
}}
|
||||
onBlur={(e) => {
|
||||
onBlur?.(e.currentTarget.value);
|
||||
}}
|
||||
style={{ width: "100%" }}
|
||||
placeholder={placeholder}
|
||||
{...restProps}
|
||||
>{currentValue}</textarea>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export function useTriliumEventBeta<T extends EventNames>(eventName: T | T[], ha
|
||||
}
|
||||
}
|
||||
|
||||
export function useSpacedUpdate(callback: () => Promise<void>, interval = 1000) {
|
||||
export function useSpacedUpdate(callback: () => void | Promise<void>, interval = 1000) {
|
||||
const callbackRef = useRef(callback);
|
||||
const spacedUpdateRef = useRef<SpacedUpdate>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user