-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to the TypeaheadSelect template #11153
base: v5
Are you sure you want to change the base?
Conversation
If there is no such function, nothing will change when clicking that button, and it is less confusing to not show it in that case.
Preview: https://patternfly-react-pr-11153.surge.sh A11y report: https://patternfly-react-pr-11153-a11y.surge.sh |
This one: # 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'.
Or not... :-) I didn't read the error message carefully enough, which is:
I have pushed a hopefully better fix. Why do you not see this error? Do we have different versions of MenuToggleProps? |
766a64d
to
cbeb8ab
Compare
Not sure why we aren't seeing this error. 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. |
Here are a few small changes to the TypeaheadSelect that we could use in Cockpit.
Thanks!