Skip to content

Commit

Permalink
fix(tearsheet): address portalTarget type (#6400)
Browse files Browse the repository at this point in the history
* fix(tearsheet): address portalTarget type

* fix(addSelect): address portalTarget type
  • Loading branch information
makafsal authored Nov 13, 2024
1 parent a4465ff commit a11d036
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions packages/ibm-products/src/components/AddSelect/AddSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// LICENSE file in the root directory of this source tree.
//

import React, { ForwardedRef, ReactNode, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import PropTypes from 'prop-types';
import { AddSelectBody } from './AddSelectBody';
import { normalize, getGlobalFilterValues } from './add-select-utils';
Expand Down Expand Up @@ -48,7 +48,7 @@ export interface AddSelectProps {
/**
* portal target for the all tags modal
*/
portalTarget?: ReactNode;
portalTarget?: HTMLElement;
searchResultsTitle?: string;
sortByLabel?: string;
title: string;
Expand Down Expand Up @@ -172,6 +172,7 @@ AddSelect.propTypes = {
/**
* portal target for the all tags modal
*/
/**@ts-ignore */
portalTarget: PropTypes.node,
searchResultsTitle: PropTypes.string,
sortByLabel: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// LICENSE file in the root directory of this source tree.
//

import React, { ForwardedRef, ReactNode, forwardRef, useState } from 'react';
import React, { ForwardedRef, forwardRef, useState } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { Tag } from '@carbon/react';
Expand Down Expand Up @@ -67,7 +67,7 @@ export interface AddSelectBodyProps {
onSubmit?: (selection) => void;
onSubmitButtonText?: string;
open?: boolean;
portalTarget?: ReactNode;
portalTarget?: HTMLElement;
searchResultsTitle?: string;
sortByLabel?: string;
title?: string;
Expand Down Expand Up @@ -457,6 +457,7 @@ AddSelectBody.propTypes = {
onSubmit: PropTypes.func,
onSubmitButtonText: PropTypes.string,
open: PropTypes.bool,
/**@ts-ignore */
portalTarget: PropTypes.node,
searchResultsTitle: PropTypes.string,
sortByLabel: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export interface TearsheetProps extends PropsWithChildren {
/**
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
*/
portalTarget?: ReactNode;
portalTarget?: HTMLElement;

/**
* Specify a CSS selector that matches the DOM element that should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
/**
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
*/
portalTarget?: ReactNode;
portalTarget?: HTMLElement;

/**
* Specify a CSS selector that matches the DOM element that should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ interface TearsheetShellProps extends PropsWithChildren {
/**
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
*/
portalTarget?: ReactNode;
portalTarget?: HTMLElement;

/**
* Specify a CSS selector that matches the DOM element that should be
Expand Down

0 comments on commit a11d036

Please sign in to comment.