DropdownItem onclick should be callback (#15926)

* React CSSProperties position made specific

* Add test for css position

* DropdownItem onClick is callback

DropdownItem onClick was an event. It should be a callback function

* Test DropdownItem onClick definitions
This commit is contained in:
Wayne Dela Cruz
2017-05-04 17:53:01 +01:00
committed by Mohamed Hegazy
parent fd008d7f76
commit 56ce2fe50d
2 changed files with 4 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ interface Props {
divider?: boolean;
tag?: React.ReactType;
header?: boolean;
onClick?: React.MouseEvent<any>;
onClick?: (event: React.MouseEvent<any>) => void;
className?: string;
}

View File

@@ -347,7 +347,9 @@ class Example15 extends React.Component<any, any> {
<DropdownItem disabled>Action</DropdownItem>
<DropdownItem>Another Action</DropdownItem>
<DropdownItem divider />
<DropdownItem>Another Action</DropdownItem>
<DropdownItem onClick={event => {
// something happens here
}}>Another Action</DropdownItem>
</DropdownMenu>
</ButtonDropdown>
);