Skip to content

Commit

Permalink
pr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Mar 27, 2024
1 parent f2c88d8 commit 5d72064
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/react-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This package provides wrapped Patternfly component demos with a streamlined API

#### Node Environment

This project currently supports Node [Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react.
This project currently supports [Node Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react.

For example, to develop with Node 18, use the following:

Expand All @@ -15,7 +15,7 @@ nvm install 18
nvm use 18
```

This project also requires a Yarn version of >=1.6.0. The latest version can be installed [here](https://yarnpkg.com/).
This project also requires a Yarn version of >=1.6.0. The latest version can be installed from the [Yarn](https://yarnpkg.com/) home page.

### Installing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { Select, SelectList } from '@patternfly/react-core/dist/esm/components/Select';
import { Select, SelectList, SelectOptionProps } from '@patternfly/react-core/dist/esm/components/Select';
import { MenuToggle, MenuToggleElement } from '@patternfly/react-core/dist/esm/components/MenuToggle';

export interface SelectSimpleProps {
/** @hide Forwarded ref */
innerRef?: React.Ref<any>;
/** Initial options of the select. */
initialOptions?: React.ReactElement[];
initialOptions?: SelectOptionProps[];
/** Callback triggered on selection. */
onSelect?: (_event: React.MouseEvent<Element, MouseEvent>, selection: string | number) => void;
/** Callback triggered when the select opens or closes. */
Expand All @@ -15,6 +15,8 @@ export interface SelectSimpleProps {
isDisabled?: boolean;
/** Content of the toggle. Defaults to the selected option. */
toggleContent?: React.ReactNode;
/** Width of the toggle */
toggleWidth?: string;
}

const SelectSimpleBase: React.FunctionComponent<SelectSimpleProps> = ({
Expand All @@ -24,6 +26,7 @@ const SelectSimpleBase: React.FunctionComponent<SelectSimpleProps> = ({
onSelect,
onToggle,
toggleContent,
toggleWidth = '200px',
...props
}: SelectSimpleProps) => {
const [isOpen, setIsOpen] = React.useState(false);
Expand All @@ -48,7 +51,7 @@ const SelectSimpleBase: React.FunctionComponent<SelectSimpleProps> = ({
isDisabled={isDisabled}
style={
{
width: '200px'
width: toggleWidth
} as React.CSSProperties
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: Select
section: components
subsection: menus
template: true
beta: true
propComponents: ['SimpleSelect']
---

Expand Down

0 comments on commit 5d72064

Please sign in to comment.