Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Fix; bug fixes in Box, Dropdown, TextArea. Mostly missing props and s…
Browse files Browse the repository at this point in the history
…upport.
  • Loading branch information
sbracegirdle committed Jun 25, 2024
1 parent 1743d37 commit 0f9e747
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function separateProps(props: ExtendedBoxProps): {
"className",
"target",
"rel",
"for",
].includes(key)
) {
acc.filteredProps[key] = (props as any)[key];
Expand Down
4 changes: 3 additions & 1 deletion src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const Dropdown = ({
loadingIndicator,
selectedIndicator,
cs,
...rest
}: DropdownProps) => {
const popRef = useRef<any>(null);
const [showPopover, setShowPopover] = useState(false);
Expand Down Expand Up @@ -120,7 +121,7 @@ const Dropdown = ({
data-cy={dataCy}
error={error}
onChange={onInputChange}
onClick={() => {
onFocus={() => {
setShowPopover(true);
}}
endAdornment={
Expand Down Expand Up @@ -172,6 +173,7 @@ const Dropdown = ({
: options?.find((item: any) => item?.id === defaultValue)?.text || ""
}
readOnly={typeof inputValue !== "string"}
{...rest}
/>
{showPopover ? (
<Popover
Expand Down
4 changes: 3 additions & 1 deletion src/components/TextArea/TextArea.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const StyledAdornment = styled.span<{
squashHeight?: boolean;
adornmentColor?: string;
overridePositionTop?: string;
allowPointerEvents?: boolean;
}>(
({
theme,
Expand All @@ -18,6 +19,7 @@ const StyledAdornment = styled.span<{
squashHeight,
adornmentColor,
overridePositionTop,
allowPointerEvents,
}) => ({
[position]: noPadding ? theme.spacing.xs : theme.spacing.sm,
paddingTop: overridePositionTop
Expand All @@ -26,7 +28,7 @@ const StyledAdornment = styled.span<{
? "0px"
: theme.spacing.xs,
position: "absolute",
pointerEvents: squashHeight ? "auto" : "none",
pointerEvents: allowPointerEvents || squashHeight ? "auto" : "none",
opacity: adornmentColor ? 1 : disabled ? 0.3 : 1,
color: adornmentColor ? getValueFromPath(theme, adornmentColor) : "inherit",
})
Expand Down
8 changes: 8 additions & 0 deletions src/components/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export interface TextAreaProps
* overrides the padding
*/
overridePadding?: keyof Spacing;

/**
* allows pointer events on adornment
*/
allowAdornmentPointerEvents?: boolean;
}

/**
Expand All @@ -79,6 +84,7 @@ const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>((props, re
noPadding,
adornmentColor,
overridePadding,
allowAdornmentPointerEvents,
...rest
} = props;

Expand Down Expand Up @@ -124,6 +130,7 @@ const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>((props, re
overridePositionTop={overridePositionTop}
disabled={props.disabled || false}
position="left"
allowPointerEvents={allowAdornmentPointerEvents}
>
{props.startAdornment}
</StyledAdornment>
Expand Down Expand Up @@ -152,6 +159,7 @@ const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>((props, re
overridePositionTop={overridePositionTop}
disabled={props.disabled || false}
position="right"
allowPointerEvents={allowAdornmentPointerEvents}
>
{props.endAdornment}
</StyledAdornment>
Expand Down

0 comments on commit 0f9e747

Please sign in to comment.