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

Fix/bug-fixes-and-gaps #145

Merged
merged 7 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govconnex/ui",
"version": "0.0.189",
"version": "0.0.192",
"description": "GovConnex UI - React Component Library",
"scripts": {
"build:tokens": "./tokens-build.sh",
Expand Down Expand Up @@ -139,4 +139,4 @@
"url": "https://github.com/GovConnex/UI/issues"
},
"homepage": "https://github.com/GovConnex/UI#readme"
}
}
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
14 changes: 7 additions & 7 deletions src/components/Dropdown/Dropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("Dropdown Component", () => {
);
const input = getByRole("textbox");

fireEvent.click(input);
fireEvent.focus(input);

await waitFor(() => {
expect(getByText("Option 1")).toBeInTheDocument();
Expand All @@ -41,7 +41,7 @@ describe("Dropdown Component", () => {
);
const input = getByRole("textbox");

fireEvent.click(input);
fireEvent.focus(input);
const option1 = getByText("Option 1");
fireEvent.click(option1);

Expand All @@ -54,7 +54,7 @@ describe("Dropdown Component", () => {
);
const input = getByRole("textbox");

fireEvent.click(input);
fireEvent.focus(input);
const option1 = getByText("Option 1");
fireEvent.click(option1);

Expand All @@ -66,7 +66,7 @@ describe("Dropdown Component", () => {
it("renders search input when hasSearch is true", () => {
const {getByRole} = render(<Dropdown label="Dropdown" options={options} hasSearch />);
const input = getByRole("textbox");
fireEvent.click(input);
fireEvent.focus(input);

const searchInput = getByRole("searchbox");
expect(searchInput).toBeInTheDocument();
Expand All @@ -83,7 +83,7 @@ describe("Dropdown Component", () => {
/>
);
const input = getByRole("textbox");
fireEvent.click(input);
fireEvent.focus(input);

const clearButton = getByText("Clear Selection");
fireEvent.click(clearButton);
Expand All @@ -102,7 +102,7 @@ describe("Dropdown Component", () => {
/>
);
const input = getByRole("textbox");
fireEvent.click(input);
fireEvent.focus(input);

const clearButton = getByText("Select All");
fireEvent.click(clearButton);
Expand All @@ -120,7 +120,7 @@ describe("Dropdown Component", () => {
/>
);
const input = getByRole("textbox");
fireEvent.click(input);
fireEvent.focus(input);

await waitFor(() => {
expect(getByText("inline-loading")).toBeInTheDocument();
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
Loading