mirror of
https://github.com/documenso/documenso.git
synced 2025-11-24 21:51:40 +10:00
chore: failed attempt at adding custom field labels
I have spent all day on it and for some reason, I can't figure it out
This commit is contained in:
@ -23,6 +23,7 @@ export type FieldItemProps = {
|
||||
minWidth?: number;
|
||||
onResize?: (_node: HTMLElement) => void;
|
||||
onMove?: (_node: HTMLElement) => void;
|
||||
onClick?: (field: Field) => void;
|
||||
onRemove?: () => void;
|
||||
};
|
||||
|
||||
@ -35,6 +36,7 @@ export const FieldItem = ({
|
||||
onResize,
|
||||
onMove,
|
||||
onRemove,
|
||||
onClick,
|
||||
}: FieldItemProps) => {
|
||||
const [active, setActive] = useState(false);
|
||||
const [coords, setCoords] = useState({
|
||||
@ -106,7 +108,10 @@ export const FieldItem = ({
|
||||
width: coords.pageWidth,
|
||||
}}
|
||||
bounds={`${PDF_VIEWER_PAGE_SELECTOR}[data-page-number="${field.pageNumber}"]`}
|
||||
onDragStart={() => setActive(true)}
|
||||
onDragStart={() => {
|
||||
setActive(true);
|
||||
onClick?.(field);
|
||||
}}
|
||||
onResizeStart={() => setActive(true)}
|
||||
onResizeStop={(_e, _d, ref) => {
|
||||
setActive(false);
|
||||
|
||||
Reference in New Issue
Block a user