diff --git a/src/components/form/PillInput.res b/src/components/form/PillInput.res index 606361856..531f5eace 100644 --- a/src/components/form/PillInput.res +++ b/src/components/form/PillInput.res @@ -1,3 +1,4 @@ +@send external focus: Dom.element => unit = "focus" @react.component let make = (~name, ~initialItems: array=[], ~placeholder, ~duplicateCheck=true) => { let form = ReactFinalForm.useForm() @@ -113,7 +114,15 @@ let make = (~name, ~initialItems: array=[], ~placeholder, ~duplicateChec setEditInput(_ => item) } -
+ let inputRef = React.useRef(Nullable.null) + let handleContainerClick = () => { + switch inputRef.current->Nullable.toOption { + | Some(inputElement) => inputElement->focus + | None => () + } + } + +
handleContainerClick()}>
{items ->Array.mapWithIndex((item, i) => @@ -142,6 +151,7 @@ let make = (~name, ~initialItems: array=[], ~placeholder, ~duplicateChec ->React.array}
ReactDOM.Ref.domRef} type_="text" value={inputValue} placeholder diff --git a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res index d5aa5d549..d7320a64b 100644 --- a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res +++ b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res @@ -191,16 +191,10 @@ let inviteEmail = FormRenderer.makeFieldInfo( ~name="email_list", ~customInput=(~input, ~placeholder as _) => { let showPlaceHolder = input.value->LogicUtils.getArrayFromJson([])->Array.length === 0 - InputFields.textTagInput( - ~input, - ~placeholder=showPlaceHolder ? "Eg: mehak.sam@wise.com, deepak.ven@wise.com" : "", - ~customButtonStyle="!rounded-full !px-4", - ~seperateByComma=true, - ) + }, ~isRequired=true, ) - module SwitchMerchantForUserAction = { @react.component let make = (~userInfoValue: UserManagementTypes.userDetailstype) => { diff --git a/src/screens/UserManagement/UserRevamp/UserManagementUtils.res b/src/screens/UserManagement/UserRevamp/UserManagementUtils.res index dd88cbf08..e3b2a4ce6 100644 --- a/src/screens/UserManagement/UserRevamp/UserManagementUtils.res +++ b/src/screens/UserManagement/UserRevamp/UserManagementUtils.res @@ -1,22 +1,5 @@ let errorClass = "text-sm leading-4 font-medium text-start ml-1 mt-2" -let inviteEmail = FormRenderer.makeFieldInfo( - ~label="Enter email", - ~name="emailList", - ~customInput=( - (~input, ~placeholder as _) => { - let showPlaceHolder = input.value->LogicUtils.getArrayFromJson([])->Array.length === 0 - InputFields.textTagInput( - ~input, - ~placeholder=showPlaceHolder ? "Eg: mehak.sam@wise.com, deepak.ven@wise.com" : "", - ~customButtonStyle="!rounded-full !px-4", - ~seperateByComma=true, - ) - } - )->InputFields.iconFieldWithMessageDes(~description="Press Enter to add more"), - ~isRequired=true, -) - let createCustomRole = FormRenderer.makeFieldInfo( ~label="Enter custom role name", ~name="role_name",