在 react-input-mask 中使用日语输入法的错误

问题描述

当我输入全角字符时,现有输入被推到右侧。

在这里查看错误: https://imgur.com/0os1ZqS

如何防止这种情况发生,因为它在使用普通数字字符时可以正常工作。

    <InputMask
      mask={mask}
      value={stateValue}
      onClick={() => setShowMask(true)}
      onChange={(e: any) => handleChange(e)}
      onBlur={() => handleBlur(stateValue)}
      placeholder={
        texts?.placeholder ||
        i18n.t('placeholder_countryCode',{
          field: texts?.field || i18n.t('default_fieldName')
        })
      }
      alwaysShowMask={showMask}
      formatChars={{
        x: '[0-90-9]'
      }}
      ref={innerRef}
    >
      {(inputProps: any) => (
        <Input
          {...inputProps}
          {...innerProps}
          type='text'
          required={isRequired}
          invalid={invalid || error.status !== true}
          className={textFieldClassName}
          style={inputInlineStyle}
        />
      )}
    </InputMask>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)