Closed mvollmer closed 2 days ago
Preview: https://patternfly-react-pr-11153.surge.sh
A11y report: https://patternfly-react-pr-11153-a11y.surge.sh
- TypeScript actually reports a typing error for the "isDisabled" property, which seems easily fixed.
Or not... :-) I didn't read the error message carefully enough, which is:
# pkg/lib/cockpit-components-typeahead-select.tsx:406:6 - error TS2375: Type '{ children: Element; className?: string; isExpanded: boolean; isDisabled: boolean | undefined; isFullHeight?: boolean; isFullWidth: boolean; splitButtonOptions?: SplitButtonOptions; ... 281 more ...; ref: Ref<...>; }' is not assignable to type 'MenuToggleProps' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
# Types of property 'isDisabled' are incompatible.
# Type 'boolean | undefined' is not assignable to type 'boolean'.
# Type 'undefined' is not assignable to type 'boolean'.
I have pushed a hopefully better fix.
Why do you not see this error? Do we have different versions of MenuToggleProps?
Not sure why we aren't seeing this error. Are you running with strict mode maybe?
Are you running with strict mode maybe?
Yes.
We have copied the template into our sources so that we can make changes like in this PR, and we lint and type-check it like the rest of the Cockpit code. If we would import the template from @patternfly/react-templates, I guess we would not see that error.
Your changes have been released in:
Thanks for your contribution! :tada:
closes# https://github.com/patternfly/patternfly-react/issues/11183 Here are a few small changes to the TypeaheadSelect that we could use in Cockpit.
Thanks!