Skip to content

Commit

Permalink
fix: Field components used in CollectionField need to forward their ref
Browse files Browse the repository at this point in the history
Removes a warning in the tests
  • Loading branch information
ptbrowne committed Jan 21, 2021
1 parent d09c1ea commit 9687414
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React, { useState, forwardRef } from 'react'
import PropTypes from 'prop-types'

import { useClient } from 'cozy-client'
Expand Down Expand Up @@ -41,17 +41,19 @@ import {
import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
import Icon from 'cozy-ui/transpiled/react/Icon'

const ContactPicker = props => {
const EditContractContactPicker = function(props, ref) {
const { t } = useI18n()
return (
<BaseContactPicker
ref={ref}
listPlaceholder={t('contractForm.listPlaceholder')}
listEmptyMessage={t('contractForm.listEmptyMessage')}
addContactLabel={t('contractForm.addContactLabel')}
{...props}
/>
)
}
const ContactPicker = forwardRef(EditContractContactPicker)

const NonGrowingDialogContent = withStyles({
root: {
Expand Down

0 comments on commit 9687414

Please sign in to comment.