| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@redallen please help with type matching. Build failed due to this issue. |
Sorry, something went wrong.
|
@quarckster looks like the problem was with incorrect onSelect type. This should do the trick. diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.tsx b/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.tsx
index 4cc061c65..86ee33ed3 100644
--- a/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.tsx
+++ b/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.tsx
@@ -23,7 +23,7 @@ export interface DropdownProps extends React.HTMLProps<HTMLDivElement> {
/** Toggle for the dropdown, examples: <DropdownToggle> or <DropdownToggleCheckbox> */
toggle: React.ReactElement<any>;
/** Function callback called when user selects item */
- onSelect?(event: React.SyntheticEvent<HTMLDivElement>): void;
+ onSelect?(event?: React.SyntheticEvent<HTMLDivElement>): void;
/** Flag to indicate if the first dropdown item should gain initial focus, set false when adding
* a specific auto-focus item (like a current selection) otherwise leave as true
*/
diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownWithContext.tsx b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownWithContext.tsx
index fe1ea2218..307e825e8 100644
--- a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownWithContext.tsx
+++ b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownWithContext.tsx
@@ -21,7 +21,7 @@ class DropdownWithContext extends React.Component<DropdownProps & InjectedOuiaPr
isGrouped: false,
position: DropdownPosition.left,
direction: DropdownDirection.down,
- onSelect: Function.prototype,
+ onSelect: (): void => undefined,
autoFocus: true,
ouiaComponentType: 'Dropdown'
};
Also don't forget to run node_modules/.bin/jest -u packages/patternfly-4/react-core/src/components/ in order to update your snapshots. |
Sorry, something went wrong.
|
@quarckster I believe @karelhala is correct. This mismatching type for onSelect is Function vs (event: SyntheticEvent<HTMLDivElement, Event>) => void. |
Sorry, something went wrong.
|
PatternFly-React preview: https://patternfly-react-pr-3135.surge.sh |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #3135 +/- ##
==========================================
- Coverage 68.98% 68.98% -0.01%
==========================================
Files 858 858
Lines 23612 23621 +9
Branches 1887 1889 +2
==========================================
+ Hits 16288 16294 +6
- Misses 6364 6366 +2
- Partials 960 961 +1
Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
Looks like the table snapshots were not updated @quarckster can you run node_modules/.bin/jest -u packages/patternfly-4/ to fix the failing tests as well? |
Sorry, something went wrong.
|
@redallen @karelhala @dlabrecq tests passed |
Sorry, something went wrong.
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Part of #2423
What: Added OUIA props to Dropdown as per #2423