Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Commit 3374951

Browse files
authored
Add direction and appendMenuTo options on SelectField (#101)
* Add direction and appendMenuTo properties * Bump up version
1 parent 88d7a86 commit 3374951

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"uniforms-bridge-json-schema": "3.5.1",
2020
"uniforms-bridge-simple-schema": "3.5.1",
2121
"uniforms-bridge-simple-schema-2": "3.5.1",
22-
"uniforms-patternfly": "4.7.3"
22+
"uniforms-patternfly": "4.7.4"
2323
},
2424
"devDependencies": {
2525
"parcel-bundler": "^1.12.5",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uniforms-patternfly",
3-
"version": "4.7.3",
3+
"version": "4.7.4",
44
"description": "Patternfly forms for uniforms",
55
"repository": "[email protected]:aerogear/uniforms-patternfly.git",
66
"author": "Gianluca <[email protected]>",

src/SelectField.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import React, { Ref, useCallback, useEffect, useMemo, useState } from 'react';
1+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
22
import {
33
Checkbox,
44
CheckboxProps,
55
Radio,
66
RadioProps,
77
Select,
8-
SelectProps,
8+
SelectDirection,
99
SelectOption,
10-
SelectVariant,
1110
SelectOptionObject,
11+
SelectProps,
12+
SelectVariant
1213
} from '@patternfly/react-core';
1314
import { connectField, FieldProps, filterDOMProps } from 'uniforms';
1415

@@ -53,6 +54,8 @@ type SelectInputProps = FieldProps<
5354
disabled?: boolean;
5455
error?: boolean;
5556
transform?: (value?: string) => string;
57+
direction: SelectDirection;
58+
menuAppendTo: HTMLElement;
5659
}
5760
>;
5861

@@ -199,6 +202,8 @@ function SelectField(props: SelectFieldProps) {
199202
onToggle={() => setExpanded(!expanded)}
200203
onSelect={handleSelect}
201204
value={props.value || (props.fieldType === Array ? [] : undefined)}
205+
menuAppendTo={props.menuAppendTo}
206+
direction={props.direction}
202207
>
203208
{selectedOptions}
204209
</Select>

0 commit comments

Comments
 (0)