@@ -27,6 +27,8 @@ import { getTextChoiceInUseValues, TextChoiceInUseValues } from './actions';
2727import { createFormInputId } from './utils' ;
2828import { isFieldFullyLocked } from './propertiesUtil' ;
2929import { MULTI_CHOICE_TYPE , TEXT_CHOICE_TYPE } from './PropDescType' ;
30+ import { Popover } from '../../Popover' ;
31+ import { OverlayTrigger } from '../../OverlayTrigger' ;
3032
3133const MIN_VALUES_FOR_SEARCH_COUNT = 2 ;
3234const HELP_TIP_BODY = < p > The set of values to be used as drop-down options to restrict data entry into this field.</ p > ;
@@ -100,6 +102,7 @@ export const TextChoiceOptionsImpl: FC<ImplProps> = memo(props => {
100102 const [ showAddValuesModal , setShowAddValuesModal ] = useState < boolean > ( ) ;
101103 const [ search , setSearch ] = useState < string > ( '' ) ;
102104 const fieldTypeId = createFormInputId ( DOMAIN_FIELD_TYPE , domainIndex , index ) ;
105+ const mvPopOverId = useMemo ( ( ) => createFormInputId ( 'mv-in-use-popover' , domainIndex , index ) , [ domainIndex , index ] ) ;
103106 const isMultiChoiceField = field . dataType . name === MULTI_CHOICE_TYPE . name ;
104107
105108 // keep a map from the updated values for the in-use field values to their original values
@@ -280,25 +283,26 @@ export const TextChoiceOptionsImpl: FC<ImplProps> = memo(props => {
280283 title = { `Add Values (max ${ maxValueCount } )` }
281284 />
282285 { allowMultiChoice && (
283- < >
284- < input
285- checked = { field . dataType . name === 'multiChoice' }
286- className = "domain-text-choice-multi"
287- disabled = { isFieldFullyLocked ( field . lockType ) || hasMultiValueInUse }
288- id = { createFormInputId ( DOMAIN_FIELD_TEXTCHOICE_MULTI , domainIndex , index ) }
289- onChange = { onAllowMultiChange }
290- type = "checkbox"
291- />
292- < span
293- title = {
294- hasMultiValueInUse
295- ? 'Multiple values are currently used by at least one data row.'
296- : ''
297- }
298- >
299- Allow multiple selections
300- </ span >
301- </ >
286+ < OverlayTrigger
287+ noShow = { ! hasMultiValueInUse }
288+ overlay = {
289+ < Popover id = { mvPopOverId } placement = "top" >
290+ Multiple values are currently used by at least one data row.
291+ </ Popover >
292+ }
293+ >
294+ < label className = "label-weight-normal" id = { mvPopOverId } >
295+ < input
296+ checked = { field . dataType . name === 'multiChoice' }
297+ className = "domain-text-choice-multi"
298+ disabled = { isFieldFullyLocked ( field . lockType ) || hasMultiValueInUse }
299+ id = { createFormInputId ( DOMAIN_FIELD_TEXTCHOICE_MULTI , domainIndex , index ) }
300+ onChange = { onAllowMultiChange }
301+ type = "checkbox"
302+ />
303+ < span > Allow multiple selections</ span >
304+ </ label >
305+ </ OverlayTrigger >
302306 ) }
303307 </ div >
304308 < div className = "col-xs-6 col-lg-4" >
0 commit comments