Skip to content
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

[Fix] Remove unwanted props from DOM + remove redundant never types from some conditional props #842

Merged
merged 3 commits into from
Mar 22, 2024
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
2 changes: 1 addition & 1 deletion src/core/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type ForcedAccessibleNameProps =

export type LoadingProps =
| {
loading?: false | never;
loading?: false;
ariaLoadingText?: never;
}
| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type AriaSelectedAmountProps =

type LoadingProps =
| {
loading?: false | never;
loading?: false;
loadingText?: string;
}
| {
Expand Down Expand Up @@ -198,7 +198,7 @@ interface InternalMultiSelectProps<T extends MultiSelectData> {

type AllowItemAdditionProps =
| {
allowItemAddition?: false | never;
allowItemAddition?: false;
itemAdditionHelpText?: never;
noItemsText: string;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/Form/Select/SingleSelect/SingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export interface InternalSingleSelectProps<T extends SingleSelectData> {

type LoadingProps =
| {
loading?: false | never;
loading?: false;
loadingText?: string;
}
| {
Expand All @@ -146,7 +146,7 @@ type LoadingProps =

type AllowItemAdditionProps =
| {
allowItemAddition?: false | never;
allowItemAddition?: false;
itemAdditionHelpText?: never;
noItemsText: string;
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ class BaseTooltip extends Component<TooltipProps & { className?: string }> {
forwardedRef,
anchorElement,
className,
onToggleButtonClick,
onCloseButtonClick,
...passProps
} = this.props;
const open = 'open' in this.props ? propsOpen : this.state.open;
Expand Down
7 changes: 4 additions & 3 deletions src/core/VisuallyHidden/VisuallyHidden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export interface VisuallyHiddenProps extends HtmlSpanProps {

const baseClassName = 'fi-visually-hidden';

const StyledVisuallyHidden = styled((props: VisuallyHiddenProps) => (
<HtmlSpan {...props} />
))`
const StyledVisuallyHidden = styled((props: VisuallyHiddenProps) => {
const { forwardedRef, ...passProps } = props;
return <HtmlSpan forwardedRef={forwardedRef} {...passProps} />;
})`
position: absolute;
clip: rect(0 0 0 0);
height: 1px;
Expand Down