Sha256: ba807726f49c56915fef5ba820f015a9ffc38ffd4d986ae2d42c9ae941d12421

Contents?: true

Size: 614 Bytes

Versions: 6

Compression:

Stored size: 614 Bytes

Contents

import React, { useEffect } from 'react'
import { components } from 'react-select'

type ClearContainerProps = {
  children: React.ReactNode,
  selectProps?: {
    id: string,
  },
  clearValue: () => void,
}

const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
  const { selectProps, clearValue } = props
  useEffect(() => {
    document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
  }, [clearValue, selectProps.id])

  return (
    <components.ClearIndicator
        className="clear_indicator"
        {...props}
    />
  )
}

export default ClearContainer

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx
playbook_ui-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx
playbook_ui-13.31.0.pre.alpha.PLAY10863202 app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx