Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const defaultProps = {
class Dropdown extends React.Component {
render() {
const {
className,
children,
className,
direction,
dropdownItems,
isOpen,
toggle,
direction,
onSelect,
isPlain,
onSelect,
position,
toggle,
...props
} = this.props;
const id = toggle.props.id || `pf-toggle-id-${currentId++}`;
Expand All @@ -76,7 +76,6 @@ class Dropdown extends React.Component {
{...props}
className={css(
styles.dropdown,
isPlain && styles.modifiers.plain,
direction === DropdownDirection.up && styles.modifiers.top,
isOpen && styles.modifiers.expanded,
className
Expand All @@ -85,7 +84,7 @@ class Dropdown extends React.Component {
this.parentRef = ref;
}}
>
{Children.map(toggle, oneToggle => cloneElement(oneToggle, { parentRef: this.parentRef, isOpen, id }))}
{Children.map(toggle, oneToggle => cloneElement(oneToggle, { parentRef: this.parentRef, isOpen, id, isPlain }))}
{isOpen && (
<DropdownMenu
component={component}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface DropdownToggleProps extends HTMLProps<HTMLButtonElement> {
isFocused?: boolean;
isHovered?: boolean;
isActive?: boolean;
isPlain?: boolean;
iconComponent?: ReactType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ DropdownToggle.propTypes = {
isHovered: PropTypes.bool,
/** Forces active state */
isActive: PropTypes.bool,
/** Display the toggle with no border or background */
isPlain: PropTypes.bool,
/** The icon to display for the toggle. Defaults to CaretDownIcon. Set to null to not show an icon. */
iconComponent: PropTypes.func
};
Expand All @@ -43,6 +45,7 @@ DropdownToggle.defaultProps = {
isFocused: false,
isHovered: false,
isActive: false,
isPlain: false,
onToggle: Function.prototype,
iconComponent: CaretDownIcon
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Kebab.propTypes = {
/** Forces hover state */
isHovered: PropTypes.bool,
/** Forces active state */
isActive: PropTypes.bool
isActive: PropTypes.bool,
/** Display the toggle with no border or background */
isPlain: PropTypes.bool
};
Kebab.defaultProps = {
id: '',
Expand All @@ -43,6 +45,7 @@ Kebab.defaultProps = {
isFocused: false,
isHovered: false,
isActive: false,
isPlain: false,
onToggle: Function.prototype
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const propTypes = {
/** Forces hover state */
isHovered: PropTypes.bool,
/** Forces active state */
isActive: PropTypes.bool
isActive: PropTypes.bool,
/** Display the toggle with no border or background */
isPlain: PropTypes.bool
};

const defaultProps = {
Expand All @@ -33,6 +35,7 @@ const defaultProps = {
isFocused: false,
isHovered: false,
isActive: false,
isPlain: false,
onToggle: Function.prototype
};

Expand Down Expand Up @@ -70,6 +73,7 @@ class DropdownToggle extends Component {
isFocused,
isActive,
isHovered,
isPlain,
onToggle,
parentRef,
id,
Expand All @@ -87,6 +91,7 @@ class DropdownToggle extends Component {
isFocused && styles.modifiers.focus,
isHovered && styles.modifiers.hover,
isActive && styles.modifiers.active,
isPlain && styles.modifiers.plain,
className
)}
onClick={_event => onToggle && onToggle(!isOpen)}
Expand Down
Loading