mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
fix: improve field sizing (#1486)
## Description Allows for smaller field sizing in addition to improving our styling when displaying labels on smaller fields. This is the minimum currently supported field size until we perform a more extensive refactor of our current drag and drop system. ## Related Issue Reported via support channels ## Changes Made - Updated our minimum size constraints - Attempted to add a general autosizing component for text and failed - Updated styling in a bunch of places to use the css `clamp()` method for dynamic sizing.
This commit is contained in:
@ -35,6 +35,8 @@ export type FieldItemProps = {
|
||||
disabled?: boolean;
|
||||
minHeight?: number;
|
||||
minWidth?: number;
|
||||
defaultHeight?: number;
|
||||
defaultWidth?: number;
|
||||
onResize?: (_node: HTMLElement) => void;
|
||||
onMove?: (_node: HTMLElement) => void;
|
||||
onRemove?: () => void;
|
||||
@ -53,6 +55,8 @@ export const FieldItem = ({
|
||||
disabled,
|
||||
minHeight,
|
||||
minWidth,
|
||||
defaultHeight,
|
||||
defaultWidth,
|
||||
onResize,
|
||||
onMove,
|
||||
onRemove,
|
||||
@ -68,8 +72,8 @@ export const FieldItem = ({
|
||||
const [coords, setCoords] = useState({
|
||||
pageX: 0,
|
||||
pageY: 0,
|
||||
pageHeight: 0,
|
||||
pageWidth: 0,
|
||||
pageHeight: defaultHeight || 0,
|
||||
pageWidth: defaultWidth || 0,
|
||||
});
|
||||
const [settingsActive, setSettingsActive] = useState(false);
|
||||
const $el = useRef(null);
|
||||
|
||||
Reference in New Issue
Block a user